https://github.com/xiaozhiliaoo/refactor
@Refactor improve code design and implement.
https://github.com/xiaozhiliaoo/refactor
Last synced: about 2 months ago
JSON representation
@Refactor improve code design and implement.
- Host: GitHub
- URL: https://github.com/xiaozhiliaoo/refactor
- Owner: xiaozhiliaoo
- License: apache-2.0
- Created: 2020-08-21T13:55:45.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-08T16:12:12.000Z (over 4 years ago)
- Last Synced: 2025-02-16T08:27:41.066Z (4 months ago)
- Language: Java
- Size: 33.2 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# @Refactor
[](https://travis-ci.org/xiaozhiliaoo/refactor)
[](https://coveralls.io/github/xiaozhiliaoo/refactor?branch=master)
[](https://search.maven.org/artifact/com.github.xiaozhiliaoo/refactor/0.0.1/jar)
[](https://javadoc.io/doc/com.github.xiaozhiliaoo/refactor)
[](https://github.com/xiaozhiliaoo/refactor/issues)
[](https://github.com/xiaozhiliaoo/refactor/issues/?q=is%3Aissue+is%3Aclosed)@Refactor improve code design and implement base on java annotation. @Refactor is used to annotate
public types, interface, class, methods, constructors, and fields to indicate code quality. also
provide some useful principles to making software clean and better. and make you always remember it.
@Refactor also provide **design review** and **code review** inspiration.## How to use it
The **@Refactor** library is deployed to maven central. You can simply add it as a dependency:
### Apache Maven
```xmlcom.github.xiaozhiliaoo
refactor
0.0.2```
### Example
1. duplicate abstraction
```java
public interface Service {
@Refactor(design = DesignSmell.DUPLICATE_ABSTRACTION, improve = "duplicate with formatForAPPList, merge them to one method")
List> formatForPCList(List list, String langType);
List> formatForAPPList(List list, String langType);
}
```2. break MVC
```java
public class Controller {
@Refactor(design = DesignSmell.BREAK_MVC, improve = "move controller`s business logic to service layer, keep web layer clean and thin")
public void doSomething() {
// do a lot of thing
service.doIt();
//do a lot of thing
}
}public class Service {
public void doIt() {
//only a little business logic
}
}
```### Viewpoint
CodeQuality = Design(80%) + Implement(20%)
good,clean design is more important than code implement.
### TODO
add smell more detail and solution
@Refactor maybe not annotation at interface method, document will be ugly.