Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Improve consoleFull reporter #652

Open
maxpatiiuk opened this issue Jun 22, 2024 · 0 comments
Open

feat: Improve consoleFull reporter #652

maxpatiiuk opened this issue Jun 22, 2024 · 0 comments

Comments

@maxpatiiuk
Copy link

maxpatiiuk commented Jun 22, 2024

Unless you are run in silent mode, console reporter will be used, regardless of other configured reporters:

if (!options.silent) {
detector.registerSubscriber(new ProgressSubscriber(options));
}

CLONE_FOUND: (payload: IEventPayload): void => cloneFound(payload.clone as IClone, this.options),

In my configuration, I have reporters: ['consoleFull'] set. However, this creates a duplication - the console reporter prints location of all detections, and then consoleFull does it again (but with more detail)

Could this be made a bit nicer?

  • make ProgressReporter use consoleFull rather than console if consoleFull reporter is enabled?
  • OR add this table to consoleFull reporter too, and print it even in silent mode:
    if (statistic && !this.options.silent) {
    const table = new Table({
    head: ['Format', 'Files analyzed', 'Total lines', 'Total tokens', 'Clones found', 'Duplicated lines', 'Duplicated tokens'],
    });
    . This way, silent:true can be enabled to prevent ProgressReporter from creating duplicate messages
  • Remove consoleFull reporter in favor of adding reporterOptions to console reporter

What I see as an ideal outcome:

  • I have a console report, with code snippets, and a summary table
  • What it streams in incrementally or appears at all once doesn't matter much
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant