Showing 5 of 5 total issues
Function cli
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
nodeGaudi.cli = function(args) {
var action = "build"; // Default action to invoke is "build".
/* Default behavior is to build a project following
- 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 doCommand
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function doCommand(command, param) {
printCommand(command, param);
switch(command) {
case "doAction":
execExtern("./nodeGaudi " + param);
Function eraseFile
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function eraseFile(file, executable) {
//g.println(habitat.getOSFamily());
if(fs.lstatSync(file).isFile()) {
try {
if(executable && habitat.getOSFamily() === 0) {
- 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
Avoid deeply nested control flow statements. Open
if(args[i+2] !== null) { action = args[i+2]; }
Function doAction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
NodeGaudiBuilder.doAction = function(action) {
self.action_start = now();
g.println(colors.yellow("[ " + self.target + " => " + self.actionName + " ]"));
for(var i = 0; i < action.length; i++) {
var command = action[i];
- 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"