Showing 8 of 12 total issues
Function run
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
run: function () {
let processCache = {};
let scanner = this.scanner;
let dbManager = this.db;
Function init
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function () {
this.createConsoleInvokers();
this.registerMsgHandlers({
'ERROR.*': (data) => {
this.error(data);
File process.js
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
const q = require('q');
const path = require('path');
Function loadSQLData
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadSQLData: function (sourceVersion, targetVersion, routeData) {
let action = common.determineAction(sourceVersion, targetVersion);
let versionSeq = common.generateVersionPatchSequence(sourceVersion, targetVersion);
let versionSqlGetPromises = [];
Function init
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
init: function () {
this.createConsoleInvokers();
this.registerMsgHandlers({
'ERROR.*': (data) => {
this.error(data);
- 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 scanDirectoryForPatchFiles
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
scanDirectoryForPatchFiles: function (dirPath, rData) {
dirPath = common.determineValue(dirPath, []);
rData = common.determineValue(rData, this.createEmptyPatchDataObject());
let currentSubDir = dirPath.join('/');
Function validatePatchFileTemplate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
validatePatchFileTemplate: function () {
let template = this.patchFileTemplate;
let found = {
action: /\$ACTION/g.test(template),
version: /\$VERSION/g.test(template),
- 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 getPatchFileProperties
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getPatchFileProperties: function (fName) { //TODO: improve handling of invalid templateMode?
let version = null, action = null, source = null, target = null, diff = null;
if (this.patchFileTemplateMode === patchFileTemplateMode.AV) {
version = this.getPatchFileVersion(fName);
- 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"