FrenchYeti/dexcalibur

View on GitHub

Showing 948 of 948 total issues

Similar blocks of code found in 3 locations. Consider refactoring.
Open

            case OPCODE.INT_TO_BYTE.byte:
                
                regX = this.getRegisterName(oper.right);
                regV = this.stack.getLocalSymbol(regX);
                v = null;
Severity: Major
Found in src/SmaliVM.js and 2 other locations - About 3 hrs to fix
src/SmaliVM.js on lines 3323..3336
src/SmaliVM.js on lines 3352..3365

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 120.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

            case OPCODE.INT_TO_CHAR.byte:
                
                regX = this.getRegisterName(oper.right);
                regV = this.stack.getLocalSymbol(regX);
                v = null;
Severity: Major
Found in src/SmaliVM.js and 2 other locations - About 3 hrs to fix
src/SmaliVM.js on lines 3308..3321
src/SmaliVM.js on lines 3352..3365

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 120.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

            case OPCODE.INT_TO_SHORT.byte:
                
                regX = this.getRegisterName(oper.right);
                regV = this.stack.getLocalSymbol(regX);
                v = null;
Severity: Major
Found in src/SmaliVM.js and 2 other locations - About 3 hrs to fix
src/SmaliVM.js on lines 3308..3321
src/SmaliVM.js on lines 3323..3336

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 120.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

Method.prototype.toJsonObject = function(fields=[],exclude=[]){
    let obj = new Object();
    if(fields.length>0){
        for(let i=0; i<fields.length; i++){
            if(this[fields[i]] != null && this[fields[i]].toJsonObject != null){
Severity: Major
Found in src/CoreClass.js - About 3 hrs to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        if(method.args.length > 0){
            let argHelp = this.makeArgsHelper(method.args);
            if(argHelp.data=="") argHelp.data = "pass:1";
            tags["@@__ARGS__@@"] = argHelp.call_signature;
            tags["@@__ARGS_DATA__@@"] = "{"+argHelp.data+"}";
    Severity: Major
    Found in src/HookManager.js and 1 other location - About 3 hrs to fix
    src/HookManager.js on lines 583..593

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 118.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        if(method.args.length > 0){
            let argHelp = this.makeArgsHelper(method.args);
            if(argHelp.data=="") argHelp.data = "pass:''";
            tags["@@__ARGS__@@"] = argHelp.call_signature;
            tags["@@__ARGS_DATA__@@"] = "{"+argHelp.data+"}";
    Severity: Major
    Found in src/HookManager.js and 1 other location - About 3 hrs to fix
    src/HookManager.js on lines 719..728

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 118.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function start has 78 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

         start(hook_script, pType=null, pExtra=null, pDevice=null){
            
            let target = null;
            let PROBE_SESSION = this.newSession();
            
    Severity: Major
    Found in src/HookManager.js - About 3 hrs to fix

      Function getMethod has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

      Class.prototype.getMethod = function(pattern, pExactMatch=0){
          let res0 = [], res1=[], rx={}, match=null;
          if(pExactMatch != CONST.EXACT_MATCH){
              for(let i in pattern){
                  rx[i] = new RegExp(pattern[i]);
      Severity: Minor
      Found in src/CoreClass.js - About 3 hrs 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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                      else if(sml[0].indexOf(':catchall')>-1){
      
                          if(this.__tmp_block != null 
                              && ( this.__tmp_block instanceof CLASS.DataBlock 
                                  || this.__tmp_block.stack.length > 0 )){
      Severity: Major
      Found in src/SmaliParser.js and 1 other location - About 3 hrs to fix
      src/SmaliParser.js on lines 543..675

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 116.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                      else if(sml[0].indexOf(LEX.LABEL.SSWITCH)==0){
      
                          if(this.__tmp_block != null
                              && (this.__tmp_block instanceof CLASS.DataBlock 
                                  || this.__tmp_block.stack.length > 0)){
      Severity: Major
      Found in src/SmaliParser.js and 1 other location - About 3 hrs to fix
      src/SmaliParser.js on lines 608..675

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 116.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function _getTestFn has 76 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _getTestFn(dataModel, pattern, caseSensitive, lazy=false){
              
              //if(lazy===true) console.debug("LAZY mode detected !");
      
              if(pattern==undefined || pattern.length==0){
      Severity: Major
      Found in src/Finder.js - About 3 hrs to fix

        Function enroll has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            async enroll( pDevice, pOtions = {}){
        
        
        
                let device = null, success=false, pf=null, pm=PlatformManager.getInstance();
        Severity: Minor
        Found in src/DeviceManager.js - About 2 hrs 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 getMethodFromClass has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            getMethodFromClass( pClass, pName, pArgs){
                let ok = null, arg=null;
                let meths = pClass.getMethod({ name:pName }, CONST.EXACT_MATCH);
        
                if(meths.length==0) return null;
        Severity: Minor
        Found in src/SmaliVM.js - About 2 hrs 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 makeHookFor has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

        Hook.prototype.makeHookFor = function(method){
            /*if(method instanceof CLASS.MissingReference){
                console.log(Chalk.bold.yellow("TODO : implement MissingReference probing"));
                this.enable = false;
                return null;
        Severity: Minor
        Found in src/HookManager.js - About 2 hrs 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 modifier has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            modifier(src){
                if(src instanceof String) src=src.split(LEX.TOKEN.SPACE);
                let mod = new Accessor.AccessFlags() , next=true;
        
                //if(src.length<2) return ERR_PARSE;
        Severity: Major
        Found in src/SmaliParser.js - About 2 hrs to fix

          Function moveBasicBlock has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function moveBasicBlock(method, bblocks, gotoLabel){
              //console.log("Moving basic blocks "+bblocks.offset+"(len:"+bblocks.blk.length+") at instr goto_"+gotoLabel);
              let bbs = [], flag=false, lastWasGoto=false, endbb=0, tmp=null;
              // find cut point
              if( method.instr != null && method.instr.length > 0){
          Severity: Major
          Found in inspectors/BytecodeCleaner/service/main.js - About 2 hrs to fix

            Function writeIndirectInvoke has 71 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                writeIndirectInvoke( pInvokerObjRef, pInvokerArgRef, pInvokedMethod, pObj, pArgs){
                    let irObj=null, irArg=null, ivObj=null, ivArg=null,  v = null, rThis=null, vThis=0, rArg=null, vArg=null;
            
                    irObj = this.vm.getRegisterName(pInvokerObjRef);
                    ivObj = this.vm.stack.getLocalSymbol(irObj); 
            Severity: Major
            Found in src/SmaliVM.js - About 2 hrs to fix

              BinaryXmlParser has 25 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class BinaryXmlParser {
                constructor(buffer) {
                  this.buffer = buffer;
                  this.cursor = 0;
                  this.strings = [];
              Severity: Minor
              Found in src/libs/BinaryXmlParser.js - About 2 hrs to fix

                Function getDeviceByIP has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                    getDeviceByIP( pIpAddress, pPort=null, pUp=true){
                        let d=null, b=null;
                        for(let i in this.devices){
                            d = this.devices[i];
                            for(let k in d.bridges){
                Severity: Minor
                Found in src/DeviceManager.js - About 2 hrs 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 compare has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                Method.prototype.compare = function(meth){
                    let diff = [];
                
                    for(let i in this){
                        switch(i){
                Severity: Minor
                Found in src/CoreClass.js - About 2 hrs 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