FrenchYeti/dexcalibur

View on GitHub

Showing 948 of 948 total issues

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

        if(typeof db[i].innerClass == 'array'){
            db[i].innerClass = [];
            for(let j in src[i].innerClass){
                db[i].innerClass.push(db[src[i].innerClass[j].id]);
            }
Severity: Major
Found in src/BackupManager.js and 1 other location - About 2 hrs to fix
src/BackupManager.js on lines 483..488

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

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

        if(typeof db[i].implements == 'array'){
            db[i].implements = [];
            for(let j in src[i].implements){
                db[i].implements.push(db[src[i].implements[j].id]);
            }
Severity: Major
Found in src/BackupManager.js and 1 other location - About 2 hrs to fix
src/BackupManager.js on lines 477..482

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

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(data.fields.size > 0){
            coll = self._db.getIndex("fields");
            coll.map(function(ref,obj){
                data.fields.data[ref] = {
                    type: SaveManager.T_FIELD,
Severity: Major
Found in inspectors/Saver/SaveManager.js and 2 other locations - About 2 hrs to fix
inspectors/Saver/SaveManager.js on lines 342..350
inspectors/Saver/SaveManager.js on lines 352..360

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

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

    toJsonObject(){
        let o = new Object();
        o.visibility = this.visibility;
    
        
Severity: Minor
Found in src/AccessFlags.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 MethodReference has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function MethodReference(cfg){
    this.fqcn = null;
    this.name = null;
    this.args = null;
    this.ret = null;
Severity: Major
Found in src/CoreClass.js - About 2 hrs to fix

    Function analyzeBlocks has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        analyzeBlocks(pMethod){
            
            let blocks =  pMethod.getBasicBlocks();
    
            if(blocks.length == 0) return null;
    Severity: Major
    Found in src/Decompiler.js - About 2 hrs to fix

      Function hook.dex.classloader.new has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              "hook.dex.classloader.new": function (ctx, event) {
                  // 1. save gathered bytecode to a file
                  // 2. disassemble this file 
                  // 3. Analyze & update graph
                  // 4. Workspace cleanup
      Severity: Major
      Found in inspectors/DynamicLoader/main.js - About 2 hrs to fix

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

        Field.prototype.toJsonObject = function(fields=null,exclude=null){
            let obj = new Object();
            /*if(fields.length>0){
                for(let i in fields){
                    if(this[fields[i]] != null && (typeof this[fields[i]] == "object")){
        Severity: Major
        Found in src/CoreClass.js - About 2 hrs to fix

          Function parse has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            parse() {
              const xmlHeader = this.readChunkHeader();
              if (xmlHeader.chunkType !== ChunkType.XML) {
                throw new Error('Invalid XML header');
              }
          Severity: Minor
          Found in src/libs/BinaryXmlParser.js - About 2 hrs to fix

            Function buildCustomScript has 50 lines of code (exceeds 25 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 2 hrs to fix

              Function writeInvoke has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  writeInvoke( pMethodRef, pParamsReg){
                      let v = null, rThis=null, vThis=0, rArg=null, vArg=null;
              
                      if(pParamsReg.length > 0){
                          rThis = this.vm.getRegisterName(pParamsReg[0]);
              Severity: Minor
              Found in src/SmaliVM.js - About 1 hr to fix

                Function newDispatcher has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    newDispatcher( pHome){
                        let $ = this;
                
                        return function (req, res) {
                            //console.log(req.path);
                Severity: Minor
                Found in src/WebServer.js - About 1 hr to fix

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

                          this.app.route('/api/manifest/activities')
                              .get(function (req, res) {
                                  // collect
                                  let dev = {
                                      data: $.project.find.activity().toJsonObject()
                  Severity: Major
                  Found in src/WebServer.js and 2 other locations - About 1 hr to fix
                  src/WebServer.js on lines 1886..1893
                  src/WebServer.js on lines 1907..1914

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

                  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

                  Method.prototype.getTryEndBlock = function(pLabel){
                      let bb = this.getBasicBlocks();
                      for(let i=0; i<bb.length; i++){
                          if(bb[i].getTryEndLabel()==pLabel){
                              return bb[i];
                  Severity: Major
                  Found in src/CoreClass.js and 2 other locations - About 1 hr to fix
                  src/CoreClass.js on lines 1776..1784
                  src/CoreClass.js on lines 1797..1805

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

                  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

                          this.app.route('/api/manifest/services')
                              .get(function (req, res) {
                                  // collect
                                  let dev = {
                                      data: $.project.find.service().toJsonObject()
                  Severity: Major
                  Found in src/WebServer.js and 2 other locations - About 1 hr to fix
                  src/WebServer.js on lines 1698..1705
                  src/WebServer.js on lines 1907..1914

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

                  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

                          this.app.route('/api/manifest/permissions')
                              .get(function (req, res) {
                                  // collect
                                  let dev = {
                                      data: $.project.find.permission().toJsonObject()
                  Severity: Major
                  Found in src/WebServer.js and 2 other locations - About 1 hr to fix
                  src/WebServer.js on lines 1698..1705
                  src/WebServer.js on lines 1886..1893

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

                  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

                  Method.prototype.getTryStartBlock = function(pLabel){
                      let bb = this.getBasicBlocks();
                      for(let i=0; i<bb.length; i++){
                          if(bb[i].getTryStartLabel()==pLabel){
                              return bb[i];
                  Severity: Major
                  Found in src/CoreClass.js and 2 other locations - About 1 hr to fix
                  src/CoreClass.js on lines 1786..1794
                  src/CoreClass.js on lines 1797..1805

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

                  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

                  Method.prototype.getCatchBlock = function(pLabel){
                      let bb = this.getBasicBlocks();
                      for(let i=0; i<bb.length; i++){
                          if(bb[i].getCatchLabel()==pLabel){
                              return bb[i];
                  Severity: Major
                  Found in src/CoreClass.js and 2 other locations - About 1 hr to fix
                  src/CoreClass.js on lines 1776..1784
                  src/CoreClass.js on lines 1786..1794

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

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

                      async enroll( pDevice, pOtions = {}){
                  
                  
                  
                          let device = null, success=false, pf=null, pm=PlatformManager.getInstance();
                  Severity: Minor
                  Found in src/DeviceManager.js - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language