FrenchYeti/dexcalibur

View on GitHub

Showing 446 of 948 total issues

Avoid deeply nested control flow statements.
Open

                        if(d[i].getException() != null)
                            ssmali.push(`${"    ".repeat(this.depth-1)}}catch(${d[i].getException().name}) :${d[i].getTarget().getCatchLabel()}`);
                        else
                            ssmali.push(`${"    ".repeat(this.depth-1)}}catchall :${d[i].getTarget().getCatchLabel()}`);
Severity: Major
Found in src/Decompiler.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        for(let m in src.methods[k]._useField[l]){
                            tab[id]._useField[l][m] = new CircularReference(
                                STUB.FIELD,
                                l
                            );
    Severity: Major
    Found in src/BackupManager.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if(bb.stack[l].right.$ !== undefined){
      
                              switch(bb.stack[l].right.__type__){
                                  case STUB_TYPE.CLASS:
                                      bb.stack[l].right = db[bb.stack[l].right.id];
      Severity: Major
      Found in src/BackupManager.js - About 45 mins to fix

        Function flattening has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        Analyzer.prototype.flattening = function(method){
            let instr = [], meta={};
            for(let i in method.instr){
                meta = {
                    label: (method.instr[i].tag !== null)? method.instr[i].tag : null,
        Severity: Minor
        Found in src/Analyzer.js - About 45 mins to fix

        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(this.isImm(regX)){
                                        this.setSymbol(regX, regX.add(regV.getValue(), oper.opcode.byte));
                                    }
        Severity: Major
        Found in src/Decompiler.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                  else if(i == "package"){
                      obj.package = this.package.toJsonObject(["name"]);
                  }
                  else if(i == "tags"){
                      obj.tags = this.tags;
          Severity: Major
          Found in src/CoreClass.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                for(let j in src.fields[k]._callers){
                                    tab[fieldSign]._callers.push(
                                        new CircularReference(
                                            STUB.METHOD,
                                            src.fields[k]._callers[j].name
            Severity: Major
            Found in src/BackupManager.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                          for(let k in this.fields){
                              m = this.fields[k].toJsonObject(["__signature__","__aliasedSignature__","alias","name","tags","type","modifiers"]);
                              if(this.inherit[k] != null) m.__inherit = true;
                              obj.fields.push(m);
                          }
              Severity: Major
              Found in src/CoreClass.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    for(let j in src.methods[k]._callers){
                                        tab[id]._callers.push(
                                            new CircularReference(
                                                STUB.METHOD,
                                                src.methods[k]._callers[j].signature()
                Severity: Major
                Found in src/BackupManager.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if(this._useClass[i] != undefined)
                                              obj._useClass.push(this._useClass[i].name);
                  Severity: Major
                  Found in src/CoreClass.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if(this._callers[j] != undefined)
                                                if(this._callers[j] instanceof Method){
                                                    //console.log("Callers -> ",this._callers[i].signature());
                                                    obj._callers.push(this._callers[j].signature());
                                                }else{
                    Severity: Major
                    Found in src/CoreClass.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                  if(this.isImm(regV))
                                                      v+= this.getImmediateValue(regV)+',';
                                                  else
                                                      v+= regX+',';
                      Severity: Major
                      Found in src/Decompiler.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if(next.hasPredecessor(blocks[i])==false){
                                                next.addPredecessor(blocks[i]);
                                            }
                        Severity: Major
                        Found in src/Decompiler.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if(this.__tmp_block.width!=null){
                                                      this.__tmp_meth.appendBlock(this.__tmp_block, this.__appendBlock_callback);
                                                      this.__tmp_block = new CLASS.BasicBlock();
                                                      this.__tmp_block.setAsGotoBlock(sml[0].split('_')[1]);
                                                  }else{
                          Severity: Major
                          Found in src/SmaliParser.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if(succ[i].isConditionalBlock()){
                                                        cont = source.pop();
                                                        source.push(cont+'{');
                                                    }else{
                                                        source.push(`${"    ".repeat(pDepth)}else{`);
                            Severity: Major
                            Found in src/Decompiler.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                  for(let m in src.methods[k]._useMethod[l]){
                                                      tab[id]._useMethod[l][m] = new CircularReference(
                                                          STUB.METHOD,
                                                          l
                                                      );
                              Severity: Major
                              Found in src/BackupManager.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    for(let m in src.methods[k]._useClass[l]){
                                                        tab[id]._useClass[l][m] = new CircularReference(
                                                            STUB.CLASS,
                                                            l
                                                        );
                                Severity: Major
                                Found in src/BackupManager.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if(this.supers[k] instanceof Class)
                                                          obj.supers.push({ 
                                                              name:this.supers[k].signature(),
                                                              alias: this.supers[k].getAlias()
                                                          }); // call signature
                                  Severity: Major
                                  Found in src/CoreClass.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                if(this.simplify >= 1 && this.isImm(regV))
                                                                    v += `${this.getImmediateValue(regV)},`;
                                                                else{
                                                                    v += `${tmp},`;
                                                                }
                                    Severity: Major
                                    Found in src/Decompiler.js - About 45 mins to fix

                                      Function method has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          method: function(db, methRef, isStaticCall){
                                      
                                              let meth = db.methods.getEntry(methRef.signature());
                                      
                                              // 1. search into indexed method 
                                      Severity: Minor
                                      Found in src/Analyzer.js - About 45 mins to fix

                                      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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language