Showing 446 of 948 total issues
Avoid deeply nested control flow statements. Open
Open
else if(sml[0].indexOf(':try_end')>-1){
this.__tmp_block.setTryEndName(sml[0]);
if(this.__tmp_block != null){
this.__tmp_meth.appendBlock(this.__tmp_block, this.__appendBlock_callback);
Avoid deeply nested control flow statements. Open
Open
if(instruct.right === undefined || instruct.right._callers === undefined){
Logger.debug("[SAST] Call : method cannot be resolved : ", instruct);
}
Avoid deeply nested control flow statements. Open
Open
else if(instr[k].opcode.type == CONST.INSTR_TYPE.RET){
Logger.debug(`Block ${i} RETURN`)
jump = true;
}
Avoid deeply nested control flow statements. Open
Open
for(let l in src.methods[k].instr){
block = src.methods[k].instr[l];
bbstub = new Core.Stub(
STUB.BASIC_BLOCK,
block,
Avoid deeply nested control flow statements. Open
Open
if(method._useClass[instruct.right.fqcn] == undefined){
method._useClass[instruct.right.fqcn] = [];
method._useClassCtr++;
}
Avoid deeply nested control flow statements. Open
Open
if(ref[search.field[i]][k] instanceof CLASS.ObjectType){
//console.log(search.field[i], ref[search.field[i]][k].name, search.field[i+1]);
return this.__checkDeepField( this.__DB.classes.getEntry(ref[search.field[i]][k].name), search, i+1);
}
else if(ref[search.field[i]][k] instanceof CLASS.BasicType){
Avoid deeply nested control flow statements. Open
Open
if(this.isImm(regV))
v+= this.getImmediateValue(regV)+',';
else
v+= regX+',';
Avoid deeply nested control flow statements. Open
Open
else if(this.__tmp_block.stack.length>0){
this.__tmp_meth.appendBlock(this.__tmp_block, this.__appendBlock_callback);
this.__tmp_block = new CLASS.BasicBlock();
this.__tmp_block.setAsGotoBlock(sml[0].split('_')[1]);
}
Avoid deeply nested control flow statements. Open
Open
if(instruct.isSetter()){
instruct.right.addSetter(method);
}else{
instruct.right.addGetter(method);
}
Avoid deeply nested control flow statements. Open
Open
if(this._useMethod[i] != undefined){
obj._useMethod.push(i); //this._useMethod[i].__signature__);
}
Function runTask
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
runTask( pTaskOffset, pStep){
let self = this;
let task = this.taskList[pTaskOffset];
// download
- 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
Open
else if(instruct.isUsingString()){
// add USAGE: NEW/READ/WRITE
data.strings.insert(new CLASS.StringValue({
Avoid deeply nested control flow statements. Open
Open
if(this._useField[i] != undefined)
obj._useField.push(this._useField[i].__signature__);
Avoid deeply nested control flow statements. Open
Open
if(this.isImm(this.getSymbol(regX)))
this.setSymbol(this.getRegisterName(oper.left[0]), regV.add(this.getImmediateValue(oper.right), oper.opcode.byte));
else{
v = `${this.getRegisterName(oper.left[0])} = ${this.getRegisterName(oper.left[1])}+${this.getImmediateValue(regV)};`;
dec.push(v);
Avoid deeply nested control flow statements. Open
Open
if(this.inherit[k] != null) m.__inherit = true;
Avoid deeply nested control flow statements. Open
Open
if(blocks[i+1].hasPredecessor(blocks[i])==false){
blocks[i+1].addPredecessor(blocks[i]);
}
Avoid deeply nested control flow statements. Open
Open
if(this.__tmp_block instanceof CLASS.DataBlock || this.__tmp_block.stack.length>0){
this.__tmp_meth.appendBlock(this.__tmp_block, this.__appendBlock_callback);
this.__tmp_block = new CLASS.BasicBlock();
}
Avoid deeply nested control flow statements. Open
Open
if(method._useField[instruct.right.signature()] == undefined){
method._useField[instruct.right.signature()] = [];
method._useFieldCtr++;
}
Avoid deeply nested control flow statements. Open
Open
if(this.simplify >= 1 && this.isImm(regV))
v += `${this.getImmediateValue(regV)},`;
else{
v += `${tmp},`;
}
Avoid deeply nested control flow statements. Open
Open
if(t !==null)
stmt[j].setTarget(t);
else{
Logger.error("Target catch block not found");
console.log( stmt[j].getTarget());