Comparing version 1.0.4 to 1.0.5
#!/usr/bin/env node | ||
'use strict' | ||
const Debug = require('debug')('main') | ||
@@ -32,3 +33,3 @@ const Program = require('commander') | ||
}).then(function (path) { | ||
var complexityReport = generateReport(path) | ||
let complexityReport = generateReport(path, reportsPath) | ||
Debug(JSON.stringify(complexityReport, null, 3)) | ||
@@ -35,0 +36,0 @@ }).catch(function (err) { |
@@ -0,1 +1,2 @@ | ||
'use strict' | ||
const Debug = require('debug')('clone') | ||
@@ -2,0 +3,0 @@ const GitClone = require('git-clone') |
@@ -0,1 +1,3 @@ | ||
'use strict' | ||
const Debug = require('debug')('computeComplexity') | ||
const Path = require('path') | ||
@@ -6,6 +8,5 @@ const Promise = require('bluebird') | ||
module.exports = function computeComplexity (paths, reportsPath) { | ||
var jsonPath = Path.join(process.cwd(), 'cc.json') | ||
var jsonReportPath = Path.join(reportsPath, 'complexity-report.json') | ||
var crPath = Path.resolve(process.execPath, '../..', 'lib/node_modules/complan/node_modules/.bin/cr') | ||
var cmd = crPath + ' -l -w -f json -e -x node_modules -o ' + jsonReportPath + ' ' + paths.join(' ') | ||
const jsonPath = Path.join(process.cwd(), 'cc.json') | ||
const crPath = Path.resolve(process.execPath, '../..', 'lib/node_modules/complan/node_modules/.bin/cr') | ||
const cmd = crPath + ' -l -w -f json -e -x node_modules -o ' + jsonPath + ' ' + paths.join(' ') | ||
return new Promise(function (resolve, reject) { | ||
@@ -16,3 +17,3 @@ Exec(cmd, function (err, stdout, stderr) { | ||
} | ||
console.log('Successfully wrote ' + jsonReportPath) | ||
Debug('Successfully wrote ' + jsonPath) | ||
resolve(jsonPath) | ||
@@ -19,0 +20,0 @@ }) |
@@ -1,7 +0,9 @@ | ||
const Fs = require('fs') | ||
'use strict' | ||
const Fse = require('fs-extra') | ||
const Path = require('path') | ||
module.exports = function (path) { | ||
module.exports = function (path, reportsPath) { | ||
var complexityReport = {} | ||
complexityReport.report = [] | ||
var jsonReport = JSON.parse(Fs.readFileSync(path, 'utf-8')) | ||
const jsonReport = JSON.parse(Fse.readFileSync(path, 'utf-8')) | ||
jsonReport.reports.forEach(function (report) { | ||
@@ -18,3 +20,5 @@ var rep = {} | ||
complexityReport.maintainability = jsonReport.maintainability | ||
Fse.writeFileSync(Path.join(reportsPath, 'complexity-report.json'), JSON.stringify(complexityReport, null, 3)) | ||
Fse.removeSync(Path.join(process.cwd(), 'cc.json')) | ||
return complexityReport | ||
} |
@@ -0,1 +1,2 @@ | ||
'use strict' | ||
const Debug = require('debug')('getJsFiles') | ||
@@ -2,0 +3,0 @@ const Dir = require('node-dir') |
@@ -0,1 +1,2 @@ | ||
'use strict' | ||
const Debug = require('debug')('util') | ||
@@ -18,4 +19,4 @@ const Fse = require('fs-extra') | ||
cleanupClonedRepos: function () { | ||
const path = Path.join(process.cwd(), 'clonedrepos') | ||
try { | ||
var path = Path.join(process.cwd(), 'clonedrepos') | ||
Debug('Removing:' + path) | ||
@@ -22,0 +23,0 @@ Fse.removeSync(path) |
{ | ||
"name": "complan", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "COMPLexity ANalyzer Tool For Javascript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
51863
18
330