FrenchYeti/dexcalibur

View on GitHub

Showing 948 of 948 total issues

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

    MOVE_WIDE:{ 
        byte:0x04, 
        instr:"move-wide", 
        reftype:ReferenceType.NONE, 
        format:Format.Format12x, 
Severity: Major
Found in src/Opcode.js and 10 other locations - About 1 hr to fix
src/Opcode.js on lines 429..439
src/Opcode.js on lines 440..450
src/Opcode.js on lines 494..504
src/Opcode.js on lines 614..624
src/Opcode.js on lines 625..635
src/Opcode.js on lines 636..646
src/Opcode.js on lines 647..657
src/Opcode.js on lines 658..668
src/Opcode.js on lines 669..680
src/Opcode.js on lines 681..691

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

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

    MOVE_WIDE_FROM16:{ 
        byte:0x05, 
        instr:"move-wide/from16", 
        reftype:ReferenceType.NONE, 
        format:Format.Format22x, 
Severity: Major
Found in src/Opcode.js and 10 other locations - About 1 hr to fix
src/Opcode.js on lines 418..428
src/Opcode.js on lines 440..450
src/Opcode.js on lines 494..504
src/Opcode.js on lines 614..624
src/Opcode.js on lines 625..635
src/Opcode.js on lines 636..646
src/Opcode.js on lines 647..657
src/Opcode.js on lines 658..668
src/Opcode.js on lines 669..680
src/Opcode.js on lines 681..691

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

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

        if(this.usesFeatures != null && this.usesFeatures.length > 0){
            o['uses-feature'] = [];
            this.usesFeatures.map(perm => {
                o['uses-feature'].push(perm.toXml());
            });
Severity: Major
Found in src/AndroidAppComponents.js and 7 other locations - About 1 hr to fix
src/AndroidAppComponents.js on lines 1817..1822
src/AndroidAppComponents.js on lines 1824..1829
src/AndroidAppComponents.js on lines 1831..1836
src/AndroidAppComponents.js on lines 1838..1843
src/AndroidAppComponents.js on lines 1850..1855
src/AndroidAppComponents.js on lines 1856..1861
src/AndroidAppComponents.js on lines 1862..1867

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

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

    CONST_WIDE_HIGH16:{ 
        byte:0x19, 
        instr:"const-wide/high16", 
        reftype:ReferenceType.NONE, 
        format:Format.Format21lh, 
Severity: Major
Found in src/Opcode.js and 10 other locations - About 1 hr to fix
src/Opcode.js on lines 418..428
src/Opcode.js on lines 429..439
src/Opcode.js on lines 440..450
src/Opcode.js on lines 494..504
src/Opcode.js on lines 614..624
src/Opcode.js on lines 625..635
src/Opcode.js on lines 636..646
src/Opcode.js on lines 658..668
src/Opcode.js on lines 669..680
src/Opcode.js on lines 681..691

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

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

        if(this.instrumentation != null && this.instrumentation.length > 0){
            o['instrumentation'] = [];
            this.instrumentation.map(perm => {
                o['instrumentation'].push(perm.toXml());
            });
Severity: Major
Found in src/AndroidAppComponents.js and 7 other locations - About 1 hr to fix
src/AndroidAppComponents.js on lines 1824..1829
src/AndroidAppComponents.js on lines 1831..1836
src/AndroidAppComponents.js on lines 1838..1843
src/AndroidAppComponents.js on lines 1850..1855
src/AndroidAppComponents.js on lines 1856..1861
src/AndroidAppComponents.js on lines 1862..1867
src/AndroidAppComponents.js on lines 1868..1873

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

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

    static fromXml(xmlobj){
        let p = new PermissionGroup();
        for(let i in xmlobj){
            if(i.startsWith('android:'))
                p[i.substr(8)] = xmlobj[i];
Severity: Major
Found in src/AndroidAppComponents.js and 1 other location - About 1 hr to fix
src/AndroidAppComponents.js on lines 723..732

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

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 REF.METHOD: 
                    db[src[i].enclosingClass.id].methods[i] = new Core.Method();
                    db[src[i].enclosingClass.id].methods[i].import(src[i]);
                    break;
Severity: Major
Found in src/BackupManager.js and 1 other location - About 1 hr to fix
src/BackupManager.js on lines 452..455

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

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 REF.FIELD:
                    db[src[i].enclosingClass.id].fields[i] = new Core.Field();
                    db[src[i].enclosingClass.id].fields[i].import(src[i]);
                    break;
Severity: Major
Found in src/BackupManager.js and 1 other location - About 1 hr to fix
src/BackupManager.js on lines 448..451

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

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

    static fromXml(xmlobj){
        let p = new PermissionTree();
        for(let i in xmlobj){
            if(i.startsWith('android:'))
                p[i.substr(8)] = xmlobj[i];
Severity: Major
Found in src/AndroidAppComponents.js and 1 other location - About 1 hr to fix
src/AndroidAppComponents.js on lines 694..703

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

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

function findTargetBasicBlocks(method, gotoLabel){
    //console.log("Searching block at :goto_"+gotoLabel);
    let targetBBs = null, found=false, offset=0, duplicate=false;
    if( method.instr != null && method.instr.length > 0){
        for(let i=0; i<method.instr.length ; i++){
Severity: Minor
Found in inspectors/BytecodeCleaner/service/main.js - About 1 hr to fix

    Function useProductionMode has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        useProductionMode(){
            const projectDependentPath = [
                '/api/hook',
                '/api/probe',
                '/api/find',
    Severity: Minor
    Found in src/WebServer.js - About 1 hr to fix

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

          toJsonObject( pOverride = {}, pExcludeList={}){
              let json = new Object();
              for(let i in this){
                  if(pExcludeList[i] === false) continue;
                  
      Severity: Minor
      Found in src/Device.js - About 1 hr to fix

        Function installServer has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            static async installServer( pDevice, pOptions = {}){
                let ver, xzpath, path, arch, tmp;
        
        
                // retrieve frida version
        Severity: Minor
        Found in src/FridaHelper.js - About 1 hr to fix

          Function buildCommand has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              buildCommand(){
                  let str = '';
          
                  console.log(this);
          
          
          Severity: Minor
          Found in src/IntentFactory.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 checkIfEligible has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

          function checkIfEligible(method){
          
              let notElgible = [
                  CONST.INSTR_TYPE.IF,
                  CONST.INSTR_TYPE.SWITCH,
          Severity: Minor
          Found in inspectors/BytecodeCleaner/service/main.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 synchronizePlatform has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              async synchronizePlatform( pName){
                  let pm = PlatformManager.getInstance(), res=false;
          
                  // select platform
                  switch(pName){
          Severity: Minor
          Found in src/DexcaliburProject.js - About 1 hr to fix

            Function verify has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                verify(){
                    let verif={ length:0, msg:{} };
                    for(let i in this){
            
                        switch(i)
            Severity: Minor
            Found in src/Configuration.js - About 1 hr to fix

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

                  AGET:{ byte:0x44, instr:"aget", parse: MainParser.Format23x, type: CONST.INSTR_TYPE.ARRAY_GETTER, reftype: ReferenceType.NONE, format: Format.Format23x, flag:Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_REGISTER },
              Severity: Major
              Found in src/Opcode.js and 3 other locations - About 1 hr to fix
              src/Opcode.js on lines 796..796
              src/Opcode.js on lines 892..892
              src/Opcode.js on lines 912..912

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

              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, 
                                      regV.getValue(), 
                                      `${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 3892..3896

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

              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

                  INT_TO_LONG:{ byte:0x81, instr:"int-to-long", parse: MainParser.move, type: CONST.INSTR_TYPE.MATH_CAST, reftype:ReferenceType.NONE, format:Format.Format12x, flag:Opcode.CAN_CONTINUE | Opcode.SETS_REGISTER | Opcode.SETS_WIDE_REGISTER },
              Severity: Major
              Found in src/Opcode.js and 3 other locations - About 1 hr to fix
              src/Opcode.js on lines 780..780
              src/Opcode.js on lines 796..796
              src/Opcode.js on lines 892..892

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

              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