<commit_before>const extract                 = require("../extract");
const meta                    = require("../extract/transpile/meta");
const reportHtml              = require("../report/html");
const reportJson              = require("../report/json");
const reportDot               = require("../report/dot/moduleLevel")();
const reportDDot              = require("../report/dot/folderLevel");
const RCScheme                = require('../report/dot/common/richModuleColorScheme.json');
const reportRCDot             = require("../report/dot/moduleLevel")(RCScheme);
const reportCsv               = require("../report/csv");
const reportErr               = require("../report/err");
const reportTeamCity          = require("../report/teamcity");
const normalizeFilesAndDirs   = require("./filesAndDirs/normalize");
const validateRuleSet         = require("./ruleSet/validate");
const normalizeRuleSet        = require("./ruleSet/normalize");
const validateOptions         = require("./options/validate");
const normalizeOptions        = require("./options/normalize");
const normalizeResolveOptions = require("./resolveOptions/normalize");

const TYPE2REPORTER      = {
    "json"     : reportJson,
    "html"     : reportHtml,
    "dot"      : reportDot,
    "ddot"     : reportDDot,
    "rcdot"    : reportRCDot,
    "csv"      : reportCsv,
    "err"      : reportErr,
    "teamcity" : reportTeamCity
};

function wrapInDependencyList(pExtractResult, pReporterOutput, pOutputType) {
    let lRetval = pExtractResult;

    if (pOutputType) {
        lRetval = Object.assign(
            {},
            pExtractResult,
            {
                modules: pReporterOutput
            }
        );
    }
    return lRetval;
}

function getReporter(pOutputType) {
    // eslint-disable-next-line security/detect-object-injection
    return TYPE2REPORTER[pOutputType] || ((x) => x);
}
<commit_msg>refactor(main): simplify dot reporter classification<commit_after>const extract                 = require("../extract");
const meta                    = require("../extract/transpile/meta");
const reportHtml              = require("../report/html");
const reportJson              = require("../report/json");
const reportDot               = require("../report/dot/moduleLevel")();
const reportDDot              = require("../report/dot/folderLevel");
const reportCsv               = require("../report/csv");
const reportErr               = require("../report/err");
const reportTeamCity          = require("../report/teamcity");
const normalizeFilesAndDirs   = require("./filesAndDirs/normalize");
const validateRuleSet         = require("./ruleSet/validate");
const normalizeRuleSet        = require("./ruleSet/normalize");
const validateOptions         = require("./options/validate");
const normalizeOptions        = require("./options/normalize");
const normalizeResolveOptions = require("./resolveOptions/normalize");

const TYPE2REPORTER      = {
    "json"     : reportJson,
    "html"     : reportHtml,
    "dot"      : reportDot,
    "rcdot"    : reportDot,
    "ddot"     : reportDDot,
    "csv"      : reportCsv,
    "err"      : reportErr,
    "teamcity" : reportTeamCity
};

function wrapInDependencyList(pExtractResult, pReporterOutput, pOutputType) {
    let lRetval = pExtractResult;

    if (pOutputType) {
        lRetval = Object.assign(
            {},
            pExtractResult,
            {
                modules: pReporterOutput
            }
        );
    }
    return lRetval;
}

function getReporter(pOutputType) {
    // eslint-disable-next-line security/detect-object-injection
    return TYPE2REPORTER[pOutputType] || ((x) => x);
}

{'fraction_non_alphanumeric': 0.13545925320250748, 'fraction_numerical': 0.0010902153175252113, 'mean_word_length': 2.3303085299455537, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3902070', 'n_tokens_mistral': 1013, 'n_tokens_neox': 998, 'n_words': 184}