FrenchYeti/dexcalibur

View on GitHub

Showing 446 of 948 total issues

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(instruction.right.name == gotoLabel){
    
                                //console.log(bblocks);
    
    
    
    Severity: Major
    Found in inspectors/BytecodeCleaner/service/main.js - About 45 mins to fix

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

          toJsonObject( pExcludeList={}){
              let o = new Object();
      
              for(let i in this){
                  if(pExcludeList[i] === false) continue;
      Severity: Minor
      Found in src/AdbWrapper.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(found[instruction.right.name]===undefined)
                              found[instruction.right.name]=1;
                          else
                              found[instruction.right.name]+=1;
      Severity: Major
      Found in inspectors/BytecodeCleaner/service/main.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            else if(lastWasGoto){
                                if(instruction.opcode.type !== CONST.INSTR_TYPE.NOP){
                                    console.log("[ERROR] CFG changed !!!");
                                }
                            }
        Severity: Major
        Found in inspectors/BytecodeCleaner/service/main.js - About 45 mins to fix

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

          HookSet.prototype.addProbe = function(probeConfig){
              if(probeConfig.method != null){
                  if(typeof probeConfig.method != "string"){
                      let probe = null;
                      for(let i=0; i<probeConfig.method.length; i++){
          Severity: Minor
          Found in src/HookManager.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(method.instr[i].hasInstr(CONST.INSTR_TYPE.RET))
                              duplicate = true;
          Severity: Major
          Found in inspectors/BytecodeCleaner/service/main.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if(c instanceof CLASS.SwitchCase){
                                    if(c.type == CONST.CASE_TYPE.PACKED)
                                        bbe.instr.push({ value:"    :pswitch_"+c.value.toString(16) });
                                    else
                                        bbe.instr.push({ value:"    "+c.value+" -> "+c.target });
            Severity: Major
            Found in src/Disassembler.js - About 45 mins to fix

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

              HookPrimitive.prototype.toIntercept = function(context,set){
              
                  let hook = new Hook(context);
              
                  hook.variables = this.variables;
              Severity: Minor
              Found in src/HookManager.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(DEBUG) console.log("block has jump :",method.instr[i].goto_name,gotoLabel,targetBBs);
              Severity: Major
              Found in inspectors/BytecodeCleaner/service/main.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if(found[instruction.right.name]===undefined)
                                        found[instruction.right.name]=1;
                                    else
                                        found[instruction.right.name]+=1;
                Severity: Major
                Found in inspectors/BytecodeCleaner/service/main.js - About 45 mins to fix

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

                  HookSet.prototype.addCustomHook = function(config){
                      if(config.method == null && config.raw == null){
                          Logger.error("[HOOK MANAGER] addCustomHook(): The method to hook is not defined");
                          return null;
                      }
                  Severity: Minor
                  Found in src/HookManager.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

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

                      static verifyField( pName, pValue){
                          let result = null;
                  
                          switch(pName)
                          {
                  Severity: Minor
                  Found in src/Configuration.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

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

                  function findCaller(method, depth=0, root=null){
                      if(root==null) root=method.__signature__;
                  
                      let cfg = { method:method, depth:depth, callers:[] };
                  
                  
                  Severity: Minor
                  Found in src/Graph.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

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

                  function renameDoubleStatic(database, method, pContext){
                  
                      if(!hasSingleCall(method)) return false;
                  
                  
                  
                  Severity: Minor
                  Found in inspectors/BytecodeCleaner/service/main.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(j !== method.instr[i].stack.length-1){
                                          console.log(method.signature(),"[:goto_"+goto_name,"] Not the last instruction")
                                      }
                  Severity: Major
                  Found in inspectors/BytecodeCleaner/service/main.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                    if(hasJump(method.instr[i].stack)){
                                        if(DEBUG) console.log("block has jump POST :",gotoLabel,targetBBs[targetBBs.length-1].stack);
                                        break;
                                    } 
                    Severity: Major
                    Found in inspectors/BytecodeCleaner/service/main.js - About 45 mins to fix

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

                      Parser.prototype.getHelp = function(){
                          if(this.help != null) return this.help;
                          let usage = "Usage: dexcalibur ";
                      
                          this.help = "";
                      Severity: Minor
                      Found in src/ArgUtils.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

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

                          toJsonObject( pExcludeList={}){
                              let o = {};
                      
                              for(let i in this){
                                  if(pExcludeList[i] === true) continue;
                      Severity: Minor
                      Found in src/DeviceProfile.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

                      Function download has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          download(pRemoteURL, pLocalPath, pCallbacks, pMode=0o666, pEncoding='binary'){
                      Severity: Minor
                      Found in src/Utils.js - About 35 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language