Skip to content

feat: Improve consoleFull reporter #652

@maxpatiiuk

Description

@maxpatiiuk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions