<commit_before>/*globals require, process */

(function () {
    'use strict';

    var reports = [],

    cli = require('commander'),
    fs = require('fs'),
    cr = require('./complexityReport'),
    check = require('check-types'),
    options,
    formatter,

    state = {
        reading: true,
        unread: 0,
        tooComplex: false
    };

    parseCommandLine();
    readSourceFiles();

    function parseCommandLine () {
        cli.
            usage('[options] <file...>').
            option(
                '-o, --output <file>',
                'specify an output file for the report'
            ).
            option(
                '-f, --format <format>',
                'specify the output format of the report'
            ).
            option(
                '-lo, --logicalor',
                'disregard operator || as source of cyclomatic complexity'
            ).
            option(
                '-sc, --switchcase',
                'disregard switch statements as source of cyclomatic complexity'
            ).
            option(
                '-fi, --forin',
                'treat for...in statements as source of cyclomatic complexity'
            ).
            option(
                '-tc, --trycatch',
                'treat catch clauses as source of cyclomatic complexity'
            ).
            option(
                '-th, --threshold <complexity>',
                'specifify the per-function complexity threshold',
                function (value) {
                    return parseInt(value, 10);
                }
            );

        cli.parse(process.argv);

        options = {
            logicalor: cli.logicalor,
            ternary: cli.ternary,
            switchcase: cli.switchcase,
            forin: cli.forin,
            trycatch: cli.trycatch,
        };

        if (check.isUnemptyString(cli.format) === false) {
            cli.format = 'plain';
        }
        formatter = require('./formats/' + cli.format);
    }

    function readSourceFiles () {
        var i;

        for (i = 0; i < cli.args.length; i += 1) {
            state.unread += 1;
            readSourceFile(cli.args[i]);<commit_msg>Re-order options.<commit_after>/*globals require, process */

(function () {
    'use strict';

    var reports = [],

    cli = require('commander'),
    fs = require('fs'),
    cr = require('./complexityReport'),
    check = require('check-types'),
    options,
    formatter,

    state = {
        reading: true,
        unread: 0,
        tooComplex: false
    };

    parseCommandLine();
    readSourceFiles();

    function parseCommandLine () {
        cli.
            usage('[options] <file...>').
            option(
                '-o, --output <file>',
                'specify an output file for the report'
            ).
            option(
                '-f, --format <format>',
                'specify the output format of the report'
            ).
            option(
                '-th, --threshold <complexity>',
                'specifify the per-function complexity threshold',
                function (value) {
                    return parseInt(value, 10);
                }
            );
            option(
                '-lo, --logicalor',
                'disregard operator || as source of cyclomatic complexity'
            ).
            option(
                '-sc, --switchcase',
                'disregard switch statements as source of cyclomatic complexity'
            ).
            option(
                '-fi, --forin',
                'treat for...in statements as source of cyclomatic complexity'
            ).
            option(
                '-tc, --trycatch',
                'treat catch clauses as source of cyclomatic complexity'
            ).

        cli.parse(process.argv);

        options = {
            logicalor: cli.logicalor,
            ternary: cli.ternary,
            switchcase: cli.switchcase,
            forin: cli.forin,
            trycatch: cli.trycatch,
        };

        if (check.isUnemptyString(cli.format) === false) {
            cli.format = 'plain';
        }
        formatter = require('./formats/' + cli.format);
    }

    function readSourceFiles () {
        var i;

        for (i = 0; i < cli.args.length; i += 1) {
            state.unread += 1;
            readSourceFile(cli.args[i]);
{'fraction_non_alphanumeric': 0.11947104423164615, 'fraction_numerical': 0.0027359781121751026, 'mean_word_length': 1.2730569948186528, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, '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': '2515280', 'n_tokens_mistral': 1200, 'n_tokens_neox': 1115, 'n_words': 290}