Open nithinkashyapn opened 6 years ago
Found it.
cqc
stops executing when the source code it's checking has some errors; but it does not seem to show the file where the error occurred.
Can there be an enhancement feature where it'll still compile the remaining files when error occurs?
cqc use babel-eslint
to parse the code, so it will abort the progress when the parse program get errors.
However only complexity checker triggers the parse program. So it's possible to add a try catch for this then we can have other checker result even if complexity checker get errors
Oh ya, we can do that. btw, cqc
is a neat npm module.
A star beckons.
Hey, One more thing. The cqc
API with format
as JSON
is resulting in a non JSON
output. Should i create a new issue or have i been wrong somewhere?
My config is like
{
ext: '.js',
ignorePath: '.gitignore',
ignorePattern: 'src/vendor/**/*.js,src/third-party/**/*.js,node_modules/**/*.js',
filterPattern: 'src/path/to/filterPattern',
jscpdMinLines: 5,
jspcdMinTokens: 70,
disableBase: false,
disableSloc: false,
disableJscpd: false,
disableComplexity: false,
format: "JSON",
verbose: false
}
Output is like
CheckerResult {
base: { numberOfFiles: 6, fileList: [Array], filterFileList: [] },
sloc:
{ total: 1257,
source: 618,
comment: 510,
single: 180,
block: 330,
mixed: 36,
empty: 165,
todo: 0 },
jscpd: { percentage: '67.22', report: [Object], map: [Map] },
complexity:
{ percentage: '0.00',
details: [],
numberOfFunctions: 258,
numberOfHighComplexityFunctions: 0,
filterDetails: [] },
[Symbol(baseOptions)]:
{ ext: '.js',
jscpdMinLines: 5,
jscpdMinTokens: 70,
complexityMax: 10,
ignorePath: '.gitignore',
ignorePattern: 'src/vendor/**/*.js,src/third-party/**/*.js,node_modules/**/*.js',
filterPattern: 'src/path/to/filterPattern',
jspcdMinTokens: 70,
disableBase: false,
disableSloc: false,
disableJscpd: false,
disableComplexity: false,
format: 'JSON',
verbose: false } }
Work around i'm using
cqc = JSON.stringify(cqcResult);
cqc = cqc.replace("CheckerResult", "CheckerResult:");
cqc = JSON.parse(cqc);
@nithinkashyapn I checked the source code and the test. The format
option only accepts lowercase json
, not JSON
Please try to use json
and tell me if there are any other issues.
I regularly keep getting the following error when running
cqc
Tried figuring it out, but couldn't wrap my head around.
Why is it so and what is the fix?