src/certScanner.js
Function constructor
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(sslDirectory, options) {
super();
this.options = options;
Function scan
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
scan(cb) {
var outputConfig = {};
var keys = {};
var certs = {};
Function processDirectory
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
let processDirectory = (dirName, cb) => {
fs.readdir(dirName, (err, files) => {
if(err) return cb(err);
async.each(files, (certFile, cb) => {
Function constructor
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Open
constructor(sslDirectory, options) {
super();
this.options = options;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getCaFor
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.getCaFor = async.memoize((certPath, cb) => {
this.readPart(certPath, 65636, (err, rawCert) => {
if(err) return cb(err);
var parsedCert;
File certScanner.js
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
var x509 = require('x509.js');
var fs = require('fs');
var async = require('async');
Function processDirectory
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
let processDirectory = (dirName, cb) => {
fs.readdir(dirName, (err, files) => {
if(err) return cb(err);
Avoid too many return
statements within this function. Open
Open
return cb(null);
Avoid too many return
statements within this function. Open
Open
return cb();
Avoid too many return
statements within this function. Open
Open
return cb();
Avoid too many return
statements within this function. Open
Open
return cb(err);
Avoid too many return
statements within this function. Open
Open
return cb();