FrenchYeti/dexcalibur

View on GitHub

Showing 948 of 948 total issues

Function load has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    static load( pContext, pProjectUID, pConfigPath = null){
        
        let project = new DexcaliburProject( pContext, pProjectUID);
        let data = null;

Severity: Minor
Found in src/DexcaliburProject.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 fromJsonObject has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    static fromJsonObject( pJson){
        let o = new DeviceProfile();

        for(let i in pJson){
            if(i == "profiles"){
Severity: Minor
Found in src/DeviceProfile.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 fullscan has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    async fullscan( pPath){
        let elemnt=null;
        let success  = false;

        // scan OS/Platform
Severity: Minor
Found in src/DexcaliburProject.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 buildCustomScript has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

Hook.prototype.buildCustomScript = 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 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 extract has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    static async extract(pApkPath, pDestination, pOption={}){
        if(_fs_.existsSync(pApkPath)==false){
            throw new Error("[APK HELPER] APK not found ");
        }
        
Severity: Minor
Found in src/ApkHelper.js - About 1 hr to fix

    Function invoke has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        invoke: function(src,raw_src){
            let instr = new CLASS.Instruction(); 
            let m = Core.RX.INVOKE.exec(raw_src), meth=null;        
            let regs = raw_src.substr(0,raw_src.lastIndexOf(","));
            
    Severity: Minor
    Found in src/Opcode.js - About 1 hr to fix

      Function method has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          method: function(db, methRef, isStaticCall){
      
              let meth = db.methods.getEntry(methRef.signature());
      
              // 1. search into indexed method 
      Severity: Minor
      Found in src/Analyzer.js - About 1 hr to fix

        Function showCFG_old has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Analyzer.prototype.showCFG_old = function(bblocks, prefix=""){
        
            let pathTRUE = Chalk.green(prefix+"    |\n"+prefix+"    |\n"+prefix+"    |\n"+prefix+"    +-----[TRUE]-->");
            let path_len = "    +-----[TRUE]-->".length;
            let pathFALSE = Chalk.red(prefix+"    |\n"+prefix+"    |\n"+prefix+"    |\n"+prefix+"    +-----[FALSE]->");
        Severity: Minor
        Found in src/Analyzer.js - About 1 hr to fix

          Function constructor has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              constructor(config=null){
                  this.$ = STUB_TYPE.BASIC_BLOCK;
          
                  this.line = -1;
                  this.prologue = false;
          Severity: Minor
          Found in src/CoreClass.js - About 1 hr to fix

            Function Hook has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function Hook(context){
                this.id = null;
            
                // ! important
                // It is used in order to link in-hook method call with method declared outside of the hook
            Severity: Minor
            Found in src/HookManager.js - About 1 hr to fix

              Function flatternGotoOf has 27 lines of code (exceeds 25 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 1 hr to fix

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

                                    this.metharea.setGlobalSymbol(
                                        `${oper.right.enclosingClass.name}.${oper.right.name}`, 
                                        DTYPE.FIELD, 
                                        null, 
                                        `${v[0]} = ${v[1]}`);
                Severity: Major
                Found in src/SmaliVM.js and 1 other location - About 1 hr to fix
                src/SmaliVM.js on lines 3900..3904

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

                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

                MissingObjectAPI.prototype.method = function(pattern){
                    let db = this.search("_log_tag:METHOD");
                    return this._search._finder._find(db.data, DataModel.method, pattern, this._search._caseSensitive, true, true);     
                }
                Severity: Major
                Found in src/Finder.js and 1 other location - About 1 hr to fix
                src/Finder.js on lines 957..960

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

                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

                            else if(typeof this.indexes[i].toJsonObject === 'function')
                                o.indexes[i] = this.indexes[i].toJsonObject();
                            else
                                o.indexes[i] = this.indexes[i];
                Severity: Major
                Found in connectors/inmemory/InMemoryDb.js and 2 other locations - About 1 hr to fix
                connectors/inmemory/InMemoryDbCollection.js on lines 69..72
                connectors/inmemory/InMemoryDbCollection.js on lines 113..116

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

                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

                MissingObjectAPI.prototype.field = function(pattern){
                    let db = this.search("_log_tag:FIELD");
                    return this._search._finder._find(db.data, DataModel.field, pattern, this._search._caseSensitive, true, true);     
                }
                Severity: Major
                Found in src/Finder.js and 1 other location - About 1 hr to fix
                src/Finder.js on lines 953..956

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

                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

                                    this.metharea.setGlobalSymbol(
                                        `${oper.right.enclosingClass.name}.${oper.right.name}`, 
                                        DTYPE.FIELD, 
                                        null, 
                                        `${v[0]} = ${v[1]}`);
                Severity: Major
                Found in src/SmaliVM.js and 1 other location - About 1 hr to fix
                src/SmaliVM.js on lines 3908..3912

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

                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(typeof this.values[i].toJsonObject === 'function')
                                o.values[i]=this.values[i].toJsonObject();
                            else
                                o.values[i]=this.values[i];
                Severity: Major
                Found in connectors/inmemory/InMemoryDbCollection.js and 2 other locations - About 1 hr to fix
                connectors/inmemory/InMemoryDb.js on lines 129..132
                connectors/inmemory/InMemoryDbCollection.js on lines 69..72

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

                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(typeof this.values[i].toJsonObject === 'function')
                                o.values[i]=this.values[i].toJsonObject();
                            else
                                o.values[i]=this.values[i];
                Severity: Major
                Found in connectors/inmemory/InMemoryDbCollection.js and 2 other locations - About 1 hr to fix
                connectors/inmemory/InMemoryDb.js on lines 129..132
                connectors/inmemory/InMemoryDbCollection.js on lines 113..116

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

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

                    print(){
                        let m=`
                Call stack :
                `;
                
                
                Severity: Minor
                Found in src/SmaliVM.js - About 1 hr to fix

                  Function getAndroidClasses has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  PlatformBuilder.prototype.getAndroidClasses = function(api_version){
                      let apiPath = Path.join(this.android_sdk,"platforms");
                      let availableApi = [], apiName = "", dstPath="", ret=null;
                  
                      if(api_version != null){
                  Severity: Minor
                  Found in src/PlatformBuilder.js - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language