Skip to content

Commit

Permalink
small workaround to make execution faster when output is csv (works b…
Browse files Browse the repository at this point in the history
…ecause csv only exports smells up to now)
  • Loading branch information
mauricioaniche committed Nov 3, 2016
1 parent 16f82ea commit a090a48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -15,7 +15,7 @@ java -jar springlint
Or if you like Maven:

```
mvn com.github.mauricioaniche:springlint-maven-plugin:0.4:springlint
mvn com.github.mauricioaniche:springlint-maven-plugin:0.5:springlint
```

Then, just check the generated html.
Expand Down
Expand Up @@ -10,6 +10,7 @@
import com.github.mauricioaniche.springlint.analysis.smells.SmellAnalysis;
import com.github.mauricioaniche.springlint.architecture.Architecture;
import com.github.mauricioaniche.springlint.domain.Repository;
import com.github.mauricioaniche.springlint.output.CSVOutput;
import com.github.mauricioaniche.springlint.output.Output;

import br.com.aniche.ck.CKNumber;
Expand All @@ -30,10 +31,14 @@ public RunAllAnalysis(Architecture arch, String projectPath, Output output) {
}

public void run() throws FileNotFoundException {
CKAnalysis ck = new CKAnalysis(arch,projectPath);

log.info("Running CK metrics");
Map<String, List<CKNumber>> ckResults = ck.run();
// FIXME: for now, CSV doesnt print code metrics, so it makes CSV more performatic
Map<String, List<CKNumber>> ckResults = null;
if(!(output instanceof CSVOutput)) {
log.info("Running CK metrics");
CKAnalysis ck = new CKAnalysis(arch,projectPath);
ckResults = ck.run();
}

log.info("Looking for smells");
SmellAnalysis smells = new SmellAnalysis(arch, projectPath);
Expand Down

0 comments on commit a090a48

Please sign in to comment.