FrenchYeti/dexcalibur

View on GitHub

Showing 948 of 948 total issues

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

                else if(bb.stack[j].opcode.type == CONST.INSTR_TYPE.NOP){
                    txt += "nop";
                }
                else if(bb.stack[j].opcode.instr.indexOf("const-string")>-1){
                    txt += bb.stack[j].opcode.instr;
Severity: Major
Found in src/Disassembler.js and 1 other location - About 6 hrs to fix
src/Disassembler.js on lines 176..186

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

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(bb.stack[j].opcode.instr.indexOf("invoke")>-1){
                txt += Chalk.bold.yellow(bb.stack[j]._raw);
            }
            else if(bb.stack[j].opcode.instr.indexOf("const-string")>-1){
                txt += bb.stack[j].opcode.instr;
Severity: Major
Found in src/Disassembler.js and 1 other location - About 6 hrs to fix
src/Disassembler.js on lines 99..109

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

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

function SearchAPI(data){
    
    // AnalyzerDatabase (specialize InMemoryDb)
    var _db = this._db = data;
    this._queryCache = [];
Severity: Major
Found in src/Finder.js - About 6 hrs to fix

    Function start has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Open

        start( pMethod, pThis, pArguments=null, pClearHeap=false){
            let opt = null, margs=null, arr=null;
    
            // clean StackMemory 
            this.stack.clear();
    Severity: Minor
    Found in src/SmaliVM.js - About 6 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 BackupManager.js has 414 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    var fs = require('fs');
    var Chalk = require("chalk");
    var Process = require("child_process");
    const Path = require("path");
    
    
    Severity: Minor
    Found in src/BackupManager.js - About 5 hrs to fix

      File main.js has 413 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      const Fs = require("fs");
      const Path = require("path")
      
      const HOOK = require("../../src/HookManager.js");
      const CLASS = require("../../src/CoreClass.js");
      Severity: Minor
      Found in inspectors/DynamicLoader/main.js - About 5 hrs to fix

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

                if(pData.classes.size > 0){
                    index = this._db.getIndex("classes");
                    for(let k in pData.classes.data){
                        o = this.context.find.get.class(k);
                        if(o != null){
        Severity: Major
        Found in inspectors/Saver/SaveManager.js and 2 other locations - About 5 hrs to fix
        inspectors/Saver/SaveManager.js on lines 182..195
        inspectors/Saver/SaveManager.js on lines 197..210

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

        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

                if(pData.fields.size > 0){
                    index = this._db.getIndex("fields");
                    for(let k in pData.fields.data){
                        o = this.context.find.get.field(k);
                        if(o != null){
        Severity: Major
        Found in inspectors/Saver/SaveManager.js and 2 other locations - About 5 hrs to fix
        inspectors/Saver/SaveManager.js on lines 167..180
        inspectors/Saver/SaveManager.js on lines 182..195

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

        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

            add(pValue, pType){
                switch(pType){
                    case OPCODE.ADD_INT_2ADDR.byte:
                    case OPCODE.ADD_LONG_2ADDR.byte:
                    case OPCODE.ADD_INT_LIT8.byte:
        Severity: Major
        Found in src/Decompiler.js and 3 other locations - About 5 hrs to fix
        src/Decompiler.js on lines 87..102
        src/Decompiler.js on lines 104..119
        src/Decompiler.js on lines 122..137

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

        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

            mul(pValue, pType){
                switch(pType){
                    case OPCODE.MUL_INT_2ADDR.byte:
                    case OPCODE.MUL_LONG_2ADDR.byte:
                    case OPCODE.MUL_INT_LIT8.byte:
        Severity: Major
        Found in src/Decompiler.js and 3 other locations - About 5 hrs to fix
        src/Decompiler.js on lines 70..85
        src/Decompiler.js on lines 87..102
        src/Decompiler.js on lines 122..137

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

        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

                if(pData.methods.size > 0){
                    index = this._db.getIndex("methods");
                    for(let k in pData.methods.data){
                        o = this.context.find.get.method(k);
                        if(o != null){
        Severity: Major
        Found in inspectors/Saver/SaveManager.js and 2 other locations - About 5 hrs to fix
        inspectors/Saver/SaveManager.js on lines 167..180
        inspectors/Saver/SaveManager.js on lines 197..210

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

        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

            sub(pValue, pType){
                switch(pType){
                    case OPCODE.SUB_INT_2ADDR.byte:
                    case OPCODE.SUB_LONG_2ADDR.byte:
                    case OPCODE.SUB_INT_LIT8.byte:
        Severity: Major
        Found in src/Decompiler.js and 3 other locations - About 5 hrs to fix
        src/Decompiler.js on lines 70..85
        src/Decompiler.js on lines 104..119
        src/Decompiler.js on lines 122..137

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

        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

            div(pValue, pType){
                switch(pType){
                    case OPCODE.DIV_INT_2ADDR.byte:
                    case OPCODE.DIV_LONG_2ADDR.byte:
                    case OPCODE.DIV_INT_LIT8.byte:
        Severity: Major
        Found in src/Decompiler.js and 3 other locations - About 5 hrs to fix
        src/Decompiler.js on lines 70..85
        src/Decompiler.js on lines 87..102
        src/Decompiler.js on lines 104..119

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

        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

        File Device.js has 408 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        
        const Logger = require("./Logger.js")();
        const _MD5_ = require("md5");
        const _FS_ = require('fs');
        const _path_ = require('path');
        Severity: Minor
        Found in src/Device.js - About 5 hrs to fix

          VM has 42 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class VM
          {
          
              /**
               * Instance of the VM  
          Severity: Minor
          Found in src/SmaliVM.js - About 5 hrs to fix

            File DexcaliburProject.js has 402 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            var Process = require("child_process");
            const _path_ = require("path");
            const Fs = require("fs");
            
            var Logger = require("./Logger.js")();
            Severity: Minor
            Found in src/DexcaliburProject.js - About 5 hrs to fix

              Function run has 136 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  run( pStack, pDepth=0){
                      let i=0, f=0, dec=null, msg=null, ctxRST=null, bbs=null, mode=SINGLE_MODE ;
                      let indent = "    ".repeat(this.depth);
              
                      // add emulated method to callstack;
              Severity: Major
              Found in src/SmaliVM.js - About 5 hrs to fix

                Function updateDeviceList has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                Open

                    updateDeviceList( pCandidateList){
                        let active = 0, b=null, d=null, id=null, dev=null;
                        let devs = {};
                
                        for(let i=0; i<pCandidateList.length; i++){
                Severity: Minor
                Found in src/DeviceManager.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

                Function setupHooks has 131 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    setupHooks( ){
                        // getMethod => should return method from  pThis class 
                        this.vm.defineHook(
                            "java.lang.Class.getMethod(<java.lang.String><java.lang.Class>[])<java.lang.reflect.Method>",
                            function( pVM, pThis, pArgs){
                Severity: Major
                Found in src/Simplifier.js - About 5 hrs to fix

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

                  class Device
                  {
                      /**
                       * 
                       * @param {*} config 
                  Severity: Minor
                  Found in src/Device.js - About 5 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language