FrenchYeti/dexcalibur

View on GitHub

Showing 948 of 948 total issues

AccessFlags has 39 functions (exceeds 20 allowed). Consider refactoring.
Open

class AccessFlags
{
    /**
     * To create a new AccessFlags 
     * @param {*} pVisibility Visiblity bitmap. Default is PUBLIC (only)
Severity: Minor
Found in src/AccessFlags.js - About 5 hrs to fix

    Function merge has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

        merge( pDevice){
            for(let i in pDevice){
                switch(i){
                    case 'enrolled':
                        if(pDevice.enrolled)
    Severity: Minor
    Found in src/Device.js - About 5 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

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

                            if(this.isImm(regV)){
    //                                this.setSymbol(regX, regX.add(regV.getValue(), oper.opcode.byte));
    
                                
                                this.stack.setLocalSymbol(
    Severity: Major
    Found in src/SmaliVM.js and 1 other location - About 5 hrs to fix
    src/SmaliVM.js on lines 1960..1988

    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 155.

    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

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

                if(this.isImm(regV)){
    //                                this.setSymbol(regX, regX.add(regV.getValue(), oper.opcode.byte));
    
                    
                    this.stack.setLocalSymbol(
    Severity: Major
    Found in src/SmaliVM.js and 1 other location - About 5 hrs to fix
    src/SmaliVM.js on lines 3082..3110

    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 155.

    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 Method has 123 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function Method(config){
        // corresponding stub type to use during export
        this.__stub_type__ = STUB_TYPE.METHOD;
        this.$ = STUB_TYPE.METHOD;
    
    
    Severity: Major
    Found in src/CoreClass.js - About 4 hrs to fix

      Function __checkDeepField has a Cognitive Complexity of 33 (exceeds 5 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 4 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 methodRaw has 122 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Disassembler.prototype.methodRaw = function(method){
      
          let bb=null, txt="", prefix="", bbe={}, line={}, result=[], c={};
          
          for(let i in method.instr){
      Severity: Major
      Found in src/Disassembler.js - About 4 hrs to fix

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

                        case OPCODE.IF_GTZ.byte:                
                            regX = this.getRegisterName(oper.left);
                            regV = this.getSymbol(regX);
                            if(this.simplify>0 && this.isImm(regV))
                                dec.push(`${indent}if( ${this.getImmediateValue(regV)} > 0 ) :cond_${oper.right.name}`);
        Severity: Major
        Found in src/Decompiler.js and 1 other location - About 4 hrs to fix
        src/Decompiler.js on lines 1502..1509

        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 152.

        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

                        case OPCODE.IF_GEZ.byte:                
                            regX = this.getRegisterName(oper.left);
                            regV = this.getSymbol(regX);
                            if(this.simplify>0 && this.isImm(regV))
                                dec.push(`${indent}if( ${this.getImmediateValue(regV)} >= 0 ) :cond_${oper.right.name}`);
        Severity: Major
        Found in src/Decompiler.js and 1 other location - About 4 hrs to fix
        src/Decompiler.js on lines 1510..1517

        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 152.

        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 mapInstructionFrom has 121 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function mapInstructionFrom(method, data, stats){
            let bb = null, instruct = null, obj = null, x = null, success=false, stmt=null, tmp=null, t=0,t1=0;
        
            if(! method instanceof CLASS.Method){
                Logger.error("[!] mapping failed : method provided is not an instance of Method.");
        Severity: Major
        Found in src/Analyzer.js - About 4 hrs to fix

          Function performBinaryOp has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
          Open

              performBinaryOp( pOpCode, pType, pDest, pSrc1, pSrc2=null){
          
                  let dst = null, src1 = null, src2 = null;
          
                  src1 = { 
          Severity: Minor
          Found in src/SmaliVM.js - About 4 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 analyzeBlocks has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
          Open

              analyzeBlocks(pMethod){
                  
                  let blocks =  pMethod.getBasicBlocks();
          
                  if(blocks.length == 0) return null;
          Severity: Minor
          Found in src/Simplifier.js - About 4 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

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

                          if(regX.hasCode()){
                              this.stack.setLocalSymbol(
                                  regV, 
                                  DTYPE.IMM_NUMERIC,
                                  null,
          Severity: Major
          Found in src/SmaliVM.js and 1 other location - About 4 hrs to fix
          src/SmaliVM.js on lines 3118..3131

          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 147.

          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

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

                                      if(regX.hasCode()){
                                          this.stack.setLocalSymbol(
                                              regV, 
                                              DTYPE.IMM_NUMERIC,
                                              null,
          Severity: Major
          Found in src/SmaliVM.js and 1 other location - About 4 hrs to fix
          src/SmaliVM.js on lines 1996..2009

          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 147.

          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

              this.getter = function(pattern=null){
                  let res = null;
                  if(pattern != null){
                      res = finder._find(
                          _db.call, DataModel.call, 
          Severity: Major
          Found in src/Finder.js and 1 other location - About 4 hrs to fix
          src/Finder.js on lines 1081..1096

          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 147.

          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

              this.setter = function(pattern=null){
                  let res = null;
                  if(pattern != null){
                      res = finder._find(
                          _db.call, DataModel.call, 
          Severity: Major
          Found in src/Finder.js and 1 other location - About 4 hrs to fix
          src/Finder.js on lines 1109..1124

          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 147.

          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 createInstance has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
          Open

              createInstance( pProject){
                  let ins = new Inspector.Inspector();
                  let hs = null;
                  let hooks = null;
          
          
          Severity: Minor
          Found in src/InspectorFactory.js - About 4 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 parseDeviceList has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
          Open

              async parseDeviceList( pDeviceListStr){
                  let dev = [], ret=null,re=null, data=null, id=null, device=null, token=null;
                  let bridge = null;
          
                  Logger.debug(pDeviceListStr);
          Severity: Minor
          Found in src/AdbWrapper.js - About 4 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

          File DexcaliburEngine.js has 356 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          const _fs_ = require('fs');
          const _path_ = require('path');
          const _os_ = require("os");
          const _url_ = require("url");
          
          
          Severity: Minor
          Found in src/DexcaliburEngine.js - About 4 hrs to fix

            File AdbWrapper.js has 356 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            const Process = require("child_process");
            const _path_ = require('path');
            
            const UT = require("./Utils.js");
            const Device = require("./Device.js");
            Severity: Minor
            Found in src/AdbWrapper.js - About 4 hrs to fix
              Severity
              Category
              Status
              Source
              Language