FrenchYeti/dexcalibur

View on GitHub

Showing 446 of 948 total issues

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

    toJsonObject(exclude=[]){
        let o = new Object();
        for(let i in this){
            if(exclude.indexOf(i)>-1) continue;
            if(this[i]==null) continue;
Severity: Minor
Found in src/CoreClass.js - About 1 hr 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 hook.reflect.method.get has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

        "hook.reflect.method.get": function (ctx, event) {
            Logger.info("[INSPECTOR][TASK] DynLoaderInspector search Method ");

            //console.log(event);
            if (event == null || event.data == null || event.data.data == null) return false;
Severity: Minor
Found in inspectors/DynamicLoader/main.js - About 1 hr 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 SecurityScanner has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function SecurityScanner(SearchApi,context)
{
    this.finder = SearchApi;
    this.context = context;

Severity: Minor
Found in src/Security.js - About 1 hr to fix

    Function makeArgsHelper has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Hook.prototype.makeArgsHelper = function(args_arr){
        if(args_arr.length ==0) return null;
        let raw_name = null;
        let helper = {
            // Value to pass to the "overload()" method of Frida
    Severity: Minor
    Found in src/HookManager.js - About 1 hr to fix

      Function findTargetBasicBlocks has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function findTargetBasicBlocks(method, gotoLabel){
          //console.log("Searching block at :goto_"+gotoLabel);
          let targetBBs = null, found=false, offset=0, duplicate=false;
          if( method.instr != null && method.instr.length > 0){
              for(let i=0; i<method.instr.length ; i++){
      Severity: Minor
      Found in inspectors/BytecodeCleaner/service/main.js - About 1 hr to fix

        Function useProductionMode has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            useProductionMode(){
                const projectDependentPath = [
                    '/api/hook',
                    '/api/probe',
                    '/api/find',
        Severity: Minor
        Found in src/WebServer.js - About 1 hr to fix

          Function toJsonObject has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              toJsonObject( pOverride = {}, pExcludeList={}){
                  let json = new Object();
                  for(let i in this){
                      if(pExcludeList[i] === false) continue;
                      
          Severity: Minor
          Found in src/Device.js - About 1 hr to fix

            Function installServer has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                static async installServer( pDevice, pOptions = {}){
                    let ver, xzpath, path, arch, tmp;
            
            
                    // retrieve frida version
            Severity: Minor
            Found in src/FridaHelper.js - About 1 hr to fix

              Function buildCommand has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  buildCommand(){
                      let str = '';
              
                      console.log(this);
              
              
              Severity: Minor
              Found in src/IntentFactory.js - About 1 hr 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 checkIfEligible has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              function checkIfEligible(method){
              
                  let notElgible = [
                      CONST.INSTR_TYPE.IF,
                      CONST.INSTR_TYPE.SWITCH,
              Severity: Minor
              Found in inspectors/BytecodeCleaner/service/main.js - About 1 hr 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 synchronizePlatform has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  async synchronizePlatform( pName){
                      let pm = PlatformManager.getInstance(), res=false;
              
                      // select platform
                      switch(pName){
              Severity: Minor
              Found in src/DexcaliburProject.js - About 1 hr to fix

                Function verify has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    verify(){
                        let verif={ length:0, msg:{} };
                        for(let i in this){
                
                            switch(i)
                Severity: Minor
                Found in src/Configuration.js - About 1 hr to fix

                  Function scan has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      async scan(){
                          let dev=[], wrapper=null, activeDev = 0, latestDefault=null;
                  
                          latestDefault = this.getDefault();
                  
                  
                  Severity: Minor
                  Found in src/DeviceManager.js - About 1 hr to fix

                    Function makeTree has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    Analyzer.prototype.makeTree = function(bblocks){
                        let last = {};
                        for(let i=0; i<bblocks.length; i++){
                            bblocks[i].offset = i;
                            if(bblocks[i].stack.length > 0){
                    Severity: Minor
                    Found in src/Analyzer.js - About 1 hr to fix

                      Function __checkDeepField has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          __checkDeepField(object,search, offset=0){
                              let ref=object, i=offset;
                      
                              if(object == null) return false;
                      
                      
                      Severity: Minor
                      Found in src/Finder.js - About 1 hr to fix

                        Function hook.reflect.method.get has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                "hook.reflect.method.get": function (ctx, event) {
                                    Logger.info("[INSPECTOR][TASK] DynLoaderInspector search Method ");
                        
                                    //console.log(event);
                                    if (event == null || event.data == null || event.data.data == null) return false;
                        Severity: Minor
                        Found in inspectors/DynamicLoader/main.js - About 1 hr to fix

                          Function getBinding has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              this.getBinding = function(bind,clsFqcn){
                                  let cls=null, ef=null, x=null, hash=null;
                                  
                                  if(clsFqcn === undefined)
                                      clsFqcn = bind.fqcn; 
                          Severity: Minor
                          Found in src/VM.js - About 1 hr to fix

                            Function fromString has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                static fromString( pType, pArrayStr){
                                    const RE  = new RegExp('[\s\t]*\[[\s\t]*(?<ctn>.*)[\s\t]*\][\s\t]*');
                                    let m = RE.exec(pArrayStr);
                                    if(m == null){
                                        throw new VM_Exception('VM002','Unable to parse bytearray parameter: invalid format');
                            Severity: Minor
                            Found in src/SmaliVM.js - About 1 hr to fix

                              Function getImmediateValue has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  getImmediateValue(pSymbol, pSeparator="", pForce=false){
                                      let v="";
                                      switch(pSymbol.type)
                                      {
                                          case DTYPE.IMM_STRING:
                              Severity: Minor
                              Found in src/SmaliVM.js - About 1 hr to fix

                                Function deploy has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                HookSet.prototype.deploy = function(){
                                    let hookManager = this.context.hook; //ctx.hook;
                                    let hook, method, hconfig;
                                
                                    // if the hookset is already deployed only not deployed hooks are generated
                                Severity: Minor
                                Found in src/HookManager.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language