FrenchYeti/dexcalibur

View on GitHub

Showing 948 of 948 total issues

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

    export(pExclude=null){
        let data={}, coll=null, pData=null;
        let self=this;

        data.methods = {data:{}, size:self._db.getIndex("methods").size()};
Severity: Minor
Found in inspectors/Saver/SaveManager.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 start has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

     start(hook_script, pType=null, pExtra=null, pDevice=null){
        
        let target = null;
        let PROBE_SESSION = this.newSession();
        
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

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

                case OPCODE.CONST_WIDE_HIGH16.byte:
                    regX = this.getRegisterName(oper.left);
                    regV = this.setSymbol(regX, DTYPE.IMM_NUMERIC, oper.right._value);
                    if(this.simplify<1)
                        dec.push(`${indent}${regX} = ${this.getImmediateValue(regV)};`);
Severity: Major
Found in src/Decompiler.js and 3 other locations - About 2 hrs to fix
src/Decompiler.js on lines 576..581
src/Decompiler.js on lines 584..591
src/Decompiler.js on lines 1009..1016

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

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 4 locations. Consider refactoring.
Open

                case OPCODE.CONST_WIDE_HIGH16.byte:
                    regX = this.getRegisterName(oper.left);
                    regV = this.setSymbol(regX, DTYPE.IMM_NUMERIC, oper.right._value);
                    if(this.simplify<1)
                        dec.push(`${indent}${regX} = ${this.getImmediateValue(regV)};`);
Severity: Major
Found in src/Decompiler.js and 3 other locations - About 2 hrs to fix
src/Decompiler.js on lines 584..591
src/Decompiler.js on lines 1001..1006
src/Decompiler.js on lines 1009..1016

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

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 4 locations. Consider refactoring.
Open

                case OPCODE.CONST_STRING.byte:
                    
                    regX = this.getRegisterName(oper.left);
                    regV = this.setSymbol(regX, DTYPE.IMM_STRING, oper.right._value);

Severity: Major
Found in src/Decompiler.js and 3 other locations - About 2 hrs to fix
src/Decompiler.js on lines 576..581
src/Decompiler.js on lines 1001..1006
src/Decompiler.js on lines 1009..1016

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

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 4 locations. Consider refactoring.
Open

                case OPCODE.CONST_STRING.byte:
                    
                    regX = this.getRegisterName(oper.left);
                    regV = this.setSymbol(regX, DTYPE.IMM_STRING, oper.right._value);

Severity: Major
Found in src/Decompiler.js and 3 other locations - About 2 hrs to fix
src/Decompiler.js on lines 576..581
src/Decompiler.js on lines 584..591
src/Decompiler.js on lines 1001..1006

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

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

DeviceManager has 24 functions (exceeds 20 allowed). Consider refactoring.
Open

class DeviceManager
{
    /**
     * To create an instance of DeviceManager
     * @param {Configuration} config The configuration object
Severity: Minor
Found in src/DeviceManager.js - About 2 hrs to fix

    Workspace has 24 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Workspace{
    
        /**
         * 
         * @param {*} pPath 
    Severity: Minor
    Found in src/Workspace.js - About 2 hrs to fix

      Inspector has 24 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Inspector{
          
          constructor(config){
              this.id = null;
              this.name = null;
      Severity: Minor
      Found in src/Inspector.js - About 2 hrs to fix

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

                else if(x instanceof CLASS.XRef){
                    sub.push({ Subject: x.calleed.signature() });
                    if(x.empty)
                        sub.push({ Subject: "\t  No reference found" });
                    else
        Severity: Major
        Found in src/Finder.js and 1 other location - About 2 hrs to fix
        src/Finder.js on lines 502..526

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

        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

                else if(x instanceof CLASS.XRef){
                    sub.push({ Subject: x.calleed.signature() });
                    if(x.empty)
                        sub.push({ Subject: "\t  No reference found" });
                    else
        Severity: Major
        Found in src/Finder.js and 1 other location - About 2 hrs to fix
        src/Finder.js on lines 451..457

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

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

            createInstance( pProject){
                let ins = new Inspector.Inspector();
                let hs = null;
                let hooks = null;
        
        
        Severity: Major
        Found in src/InspectorFactory.js - About 2 hrs to fix

          Function runDecompile has 65 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              runDecompile(pTree, pSource=[], pDepth=0, pStop=false, pClose=false){
                  let cont = true, source=pSource, res={ depth:0 }, succ=null, pred=[], d=null, tmp=null;
                  let next = [], ifelse=false;
                  
                  console.log(this.dump(pTree));
          Severity: Major
          Found in src/Decompiler.js - About 2 hrs to fix

            Function fromXml has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

                static fromXml(config, context){
                    let self = new AndroidManifest();
                    // init manifest attributes 
                    for(let i in config){
                        switch(i){
            Severity: Minor
            Found in src/AndroidAppComponents.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 makeArgsHelper has a Cognitive Complexity of 19 (exceeds 5 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 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 flatternGotoOf has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

            function flatternGotoOf(method){
            
                let blocksToMove = null;
                let singleGoto = findSingleGoto(method);
                let ret = false;
            Severity: Minor
            Found in inspectors/BytecodeCleaner/service/main.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 findSingleGoto has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

            function findSingleGoto(method){
                let found = {}, singles = [];
                
            
                // count GOTOs
            Severity: Minor
            Found in inspectors/BytecodeCleaner/service/main.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 searchInternalDependencies has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

                static searchInternalDependencies(_context_, activity){
                    if(activity==null) return false;
            
                    let cls = activity.getImplementedBy();
                    if(cls == null){
            Severity: Minor
            Found in inspectors/ApplicationTopography/src/ClassAnalyzer.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 VM has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function VM() {
                this._reg= [];
                this._regSize= 0;
                this._local= [];
                this._localSize= 0;
            Severity: Major
            Found in src/VM.js - About 2 hrs to fix

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

                  DIV_LONG:{ byte:0x9e, instr:"div-long", ope: CONST.LEX.TOKEN.DIV, parse: MainParser.Format23x, type: CONST.INSTR_TYPE.MATH, reftype: ReferenceType.NONE, format: Format.Format23x, flag:Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_REGISTER | Opcode.SETS_WIDE_REGISTER },
              Severity: Major
              Found in src/Opcode.js and 3 other locations - About 2 hrs to fix
              src/Opcode.js on lines 944..944
              src/Opcode.js on lines 976..976
              src/Opcode.js on lines 977..977

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

              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

              Severity
              Category
              Status
              Source
              Language