FrenchYeti/dexcalibur

View on GitHub
src/HookManager.js

Summary

Maintainability
F
1 wk
Test Coverage

File HookManager.js has 1251 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var FRIDA = null; 
const co = require("co");
const fs = require("fs");
const md5 = require("md5");
const Chalk = require("chalk");
Severity: Major
Found in src/HookManager.js - About 3 days to fix

    HookManager has 34 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class HookManager
    {
        /**
         * 
         * @param {*} pProject 
    Severity: Minor
    Found in src/HookManager.js - About 4 hrs to fix

      Function makeHookFor has 85 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Hook.prototype.makeHookFor = function(method){
          /*if(method instanceof CLASS.MissingReference){
              console.log(Chalk.bold.yellow("TODO : implement MissingReference probing"));
              this.enable = false;
              return null;
      Severity: Major
      Found in src/HookManager.js - About 3 hrs to fix

        Function start has 78 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

             start(hook_script, pType=null, pExtra=null, pDevice=null){
                
                let target = null;
                let PROBE_SESSION = this.newSession();
                
        Severity: Major
        Found in src/HookManager.js - About 3 hrs to fix

          Function makeHookFor has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

          Hook.prototype.makeHookFor = 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

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

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

               start(hook_script, pType=null, pExtra=null, pDevice=null){
                  
                  let target = null;
                  let PROBE_SESSION = this.newSession();
                  
          Severity: Minor
          Found in src/HookManager.js - About 2 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

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

          Hook.prototype.makeArgsHelper = function(args_arr){
              if(args_arr.length ==0) return null;
              let raw_name = null;
              let helper = {
                  // Value to pass to the "overload()" method of Frida
          Severity: Minor
          Found in src/HookManager.js - About 2 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function deploy has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

          HookSet.prototype.deploy = function(){
              let hookManager = this.context.hook; //ctx.hook;
              let hook, method, hconfig;
          
              // if the hookset is already deployed only not deployed hooks are generated
          Severity: Minor
          Found in src/HookManager.js - About 2 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function hookRoutine has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  var hookRoutine = co.wrap(function *() {
                      let session = null, pid=null, applications=null, bridge=null;
                      
                      let device = null;
          
          
          Severity: Major
          Found in src/HookManager.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 makeArgsHelper has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Hook.prototype.makeArgsHelper = function(args_arr){
                  if(args_arr.length ==0) return null;
                  let raw_name = null;
                  let helper = {
                      // Value to pass to the "overload()" method of Frida
              Severity: Minor
              Found in src/HookManager.js - About 1 hr to fix

                Function deploy has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                HookSet.prototype.deploy = function(){
                    let hookManager = this.context.hook; //ctx.hook;
                    let hook, method, hconfig;
                
                    // if the hookset is already deployed only not deployed hooks are generated
                Severity: Minor
                Found in src/HookManager.js - About 1 hr to fix

                  Function toIntercept has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  HookPrimitive.prototype.toIntercept = function(context,set){
                  
                      let hook = new Hook(context);
                  
                      hook.variables = this.variables;
                  Severity: Minor
                  Found in src/HookManager.js - About 1 hr to fix

                    Function addIntercept has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    HookSet.prototype.addIntercept = function(interceptConfig){
                        if(interceptConfig.method == null && interceptConfig.raw == null){
                            Logger.error("[HOOK MANAGER] addIntercept(): The method to hook is not defined");
                            return null;
                        }
                    Severity: Minor
                    Found in src/HookManager.js - About 1 hr to fix

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

                        Hook.prototype.toJsonObject = function(){
                            let o = new Object();
                            o.id = this.id;
                            o.parentID = this.parentID;
                            o.color = this.color;
                        Severity: Minor
                        Found in src/HookManager.js - About 1 hr to fix

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

                          HookSet.prototype.toJsonObject = function(){
                              let o = new Object();
                              for(let i in this){
                                  switch(i){
                                      case "id":
                          Severity: Minor
                          Found in src/HookManager.js - About 1 hr to fix

                            Function prepareHookScript has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                                prepareHookScript(){
                                    let script = `Java.perform(function() {
                                        var DEXC_MODULE = {};
                                    `;
                            
                            
                            Severity: Minor
                            Found in src/HookManager.js - About 55 mins 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 addIntercept has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                            HookSet.prototype.addIntercept = function(interceptConfig){
                                if(interceptConfig.method == null && interceptConfig.raw == null){
                                    Logger.error("[HOOK MANAGER] addIntercept(): The method to hook is not defined");
                                    return null;
                                }
                            Severity: Minor
                            Found in src/HookManager.js - About 55 mins 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 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                            HookSet.prototype.toJsonObject = function(){
                                let o = new Object();
                                for(let i in this){
                                    switch(i){
                                        case "id":
                            Severity: Minor
                            Found in src/HookManager.js - About 55 mins 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 toIntercept has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                            HookPrimitive.prototype.toIntercept = function(context,set){
                            
                                let hook = new Hook(context);
                            
                                hook.variables = this.variables;
                            Severity: Minor
                            Found in src/HookManager.js - About 45 mins 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 addProbe has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                            HookSet.prototype.addProbe = function(probeConfig){
                                if(probeConfig.method != null){
                                    if(typeof probeConfig.method != "string"){
                                        let probe = null;
                                        for(let i=0; i<probeConfig.method.length; i++){
                            Severity: Minor
                            Found in src/HookManager.js - About 45 mins 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 addCustomHook has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                            HookSet.prototype.addCustomHook = function(config){
                                if(config.method == null && config.raw == null){
                                    Logger.error("[HOOK MANAGER] addCustomHook(): The method to hook is not defined");
                                    return null;
                                }
                            Severity: Minor
                            Found in src/HookManager.js - About 45 mins 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 makeRetHelper has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                            Hook.prototype.makeRetHelper = function(ret){
                                if(ret == null) return null;
                            
                                let helper = {
                                    // Format string for the logger
                            Severity: Minor
                            Found in src/HookManager.js - About 35 mins 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 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                            Hook.prototype.toJsonObject = function(){
                                let o = new Object();
                                o.id = this.id;
                                o.parentID = this.parentID;
                                o.color = this.color;
                            Severity: Minor
                            Found in src/HookManager.js - About 25 mins 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 write has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                write(){
                                    let str=` [
                                        `;
                                    for(let i=0; i<this.data.length; i++){
                                        if(typeof this.data[i] == 'string'){
                            Severity: Minor
                            Found in src/HookManager.js - About 25 mins 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 push has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                push(msg){
                                    let hm = new HookMessage();
                            
                                    if(msg.type == "error") return null;
                            
                            
                            Severity: Minor
                            Found in src/HookManager.js - About 25 mins to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

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

                                if(method.args.length > 0){
                                    let argHelp = this.makeArgsHelper(method.args);
                                    if(argHelp.data=="") argHelp.data = "pass:''";
                                    tags["@@__ARGS__@@"] = argHelp.call_signature;
                                    tags["@@__ARGS_DATA__@@"] = "{"+argHelp.data+"}";
                            Severity: Major
                            Found in src/HookManager.js and 1 other location - About 3 hrs to fix
                            src/HookManager.js on lines 719..728

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

                            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(method.args.length > 0){
                                    let argHelp = this.makeArgsHelper(method.args);
                                    if(argHelp.data=="") argHelp.data = "pass:1";
                                    tags["@@__ARGS__@@"] = argHelp.call_signature;
                                    tags["@@__ARGS_DATA__@@"] = "{"+argHelp.data+"}";
                            Severity: Major
                            Found in src/HookManager.js and 1 other location - About 3 hrs to fix
                            src/HookManager.js on lines 583..593

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

                            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

                                removeHooksOf(hookset){
                                    let npro = [];
                                    for(let i=0; i<this.hooks.length; i++){
                                        if(this.hooks[i].parentID != hookset.getID()){
                                            npro.push(this.hooks[i]);
                            Severity: Major
                            Found in src/HookManager.js and 1 other location - About 2 hrs to fix
                            src/HookManager.js on lines 1729..1737

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

                            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

                                removePrologueOf(hookset){
                                    let npro = [];
                                    for(let i=0; i<this.prologues.length; i++){
                                        if(this.prologues[i].parentID != hookset.getID()){
                                            npro.push(this.prologues[i]);
                            Severity: Major
                            Found in src/HookManager.js and 1 other location - About 2 hrs to fix
                            src/HookManager.js on lines 1740..1748

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

                            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{
                                        config.custom = true;
                                        primitive = new HookPrimitive(config);
                                        primitive.isIntercept = true;
                                        primitive.isCustom = true;
                            Severity: Major
                            Found in src/HookManager.js and 1 other location - About 1 hr to fix
                            src/HookManager.js on lines 1929..1938

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

                            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

                                        for(let i=0; i<config.method.length; i++){
                                            config.custom = true;
                                            primitive = new HookPrimitive(config);
                                            primitive.isIntercept = true;
                                            primitive.isCustom = true;
                            Severity: Major
                            Found in src/HookManager.js and 1 other location - About 1 hr to fix
                            src/HookManager.js on lines 1939..1948

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

                            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

                            There are no issues that match your filters.

                            Category
                            Status