-
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(reporters): Add silent reporter
- Loading branch information
Andrii Kucherenko
committed
Aug 17, 2018
1 parent
c61bc6a
commit 517d2ee
Showing
13 changed files
with
82 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ node_modules | |
build | ||
report | ||
test | ||
.idea | ||
src/**.js | ||
|
||
coverage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ coverage | |
.nyc_output | ||
*.log | ||
.jscpd | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env node | ||
|
||
var path = require('path'); | ||
require(path.resolve(__dirname, "../build/main/cli")); | ||
require(path.resolve(__dirname, "../build/cli")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { bold } from 'colors/safe'; | ||
import { END_EVENT, Events } from '../events'; | ||
import { IOptions } from '../interfaces/options.interface'; | ||
import { IReporter } from '../interfaces/reporter.interface'; | ||
import { STATISTIC_DB } from '../stores/models'; | ||
import { StoresManager } from '../stores/stores-manager'; | ||
|
||
export class SilentReporter implements IReporter { | ||
constructor(private options: IOptions) { | ||
} | ||
|
||
public attach(): void { | ||
Events.on(END_EVENT, this.finish.bind(this)); | ||
} | ||
|
||
|
||
private finish() { | ||
const statistic = StoresManager.getStore(STATISTIC_DB).get( | ||
this.options.executionId | ||
); | ||
if (statistic) { | ||
console.log( | ||
`Duplications detection: Found ${bold(statistic.all.clones)} `+ | ||
`exact clones with ${bold(statistic.all.duplicatedLines)}(${statistic.all.percentage}%) `+ | ||
`duplicated lines in ${bold(statistic.all.sources)} ` + | ||
`(${Object.keys(statistic.formats).length} formats) files.` | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.