atsid/circuits-js

View on GitHub

Showing 90 of 90 total issues

File TestServicePlugins.js has 276 lines of code (exceeds 250 allowed). Consider refactoring.
Open

define([
    "circuits/ServiceFactory",
    "circuits/Service",
    "circuits/ZypSMDReader",
    "circuits/Request",
Severity: Minor
Found in test/TestServicePlugins.js - About 2 hrs to fix

    Function invokeXhrSend has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            invokeXhrSend: function (params) {
                var xhr = new XMLHttpRequest(),
                    async = typeof (params.asynchronous) === "boolean" ? params.asynchronous : this.asynchronous,
    
                    readystatechange = function () {
    Severity: Major
    Found in js/NativeXhrDataProvider.js - About 2 hrs to fix

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

              constructor: function (config) {
                  var namespace = (config && config.namespace) || this.declaredClass,
                      getNamespaceObject = function (key, storage) {
                          var item = JSON.parse(storage.getItem(namespace));
                          return item[key];
      Severity: Major
      Found in js/WebStorage.js - About 2 hrs to fix

        Function convertCallbackParam has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                        this.convertCallbackParam = function (param) {
                            var ret = param || [], plugin;
        
                            if (param && Object.prototype.toString.call(param) !== "[object Array]") {
                                ret = [];
        Severity: Major
        Found in js/Service.js - About 2 hrs to fix

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

                                  if (param.progress) {
                                      logger.debug("Generating plugin on error (onError)");
                                      plugin = {name: 'generatedOnProgress', fn: param.progress, type: 'progress'};
                                      plugin.scope = param.scope || plugin;
                                      ret.push(plugin);
          Severity: Major
          Found in js/Service.js and 1 other location - About 2 hrs to fix
          js/Service.js on lines 150..155

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

          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 (param.onProgress) {
                                      logger.debug("Generating plugin on load (onLoad)");
                                      plugin = {name: 'generatedOnProgress', fn: param.onProgress, type: 'progress'};
                                      plugin.scope = param.scope || plugin;
                                      ret.push(plugin);
          Severity: Major
          Found in js/Service.js and 1 other location - About 2 hrs to fix
          js/Service.js on lines 156..161

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

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

                                  if (param.onError) {
                                      logger.debug("Generating handler plugin on error (onError)");
                                      plugin = {name: 'generatedHandlerError', fn: param.onError};
                                      plugin.scope = param.scope || plugin;
                                      ret.push(new HandlerErrorPlugin(plugin));
          Severity: Major
          Found in js/Service.js and 6 other locations - About 2 hrs to fix
          js/Service.js on lines 108..113
          js/Service.js on lines 114..119
          js/Service.js on lines 120..125
          js/Service.js on lines 126..131
          js/Service.js on lines 132..137
          js/Service.js on lines 138..143

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

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

                                  if (param.timeout) {
                                      logger.debug("Generating handler plugin on timeout (timeout)");
                                      plugin = {name: 'generatedHandlerTimeout', fn: param.timeout};
                                      plugin.scope = param.scope || plugin;
                                      ret.push(new HandlerTimeoutPlugin(plugin));
          Severity: Major
          Found in js/Service.js and 6 other locations - About 2 hrs to fix
          js/Service.js on lines 114..119
          js/Service.js on lines 120..125
          js/Service.js on lines 126..131
          js/Service.js on lines 132..137
          js/Service.js on lines 138..143
          js/Service.js on lines 144..149

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

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

                                  if (param.error) {
                                      logger.debug("Generating handler plugin on error (error)");
                                      plugin = {name: 'generatedHandlerError', fn: param.error};
                                      plugin.scope = param.scope || plugin;
                                      ret.push(new HandlerErrorPlugin(plugin));
          Severity: Major
          Found in js/Service.js and 6 other locations - About 2 hrs to fix
          js/Service.js on lines 108..113
          js/Service.js on lines 114..119
          js/Service.js on lines 126..131
          js/Service.js on lines 132..137
          js/Service.js on lines 138..143
          js/Service.js on lines 144..149

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

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

                                  if (param.onTimeout) {
                                      logger.debug("Generating handler plugin on timeout (onTimeout)");
                                      plugin = {name: 'generatedHandlerTimeout', fn: param.timeout};
                                      plugin.scope = param.scope || plugin;
                                      ret.push(new HandlerTimeoutPlugin(plugin));
          Severity: Major
          Found in js/Service.js and 6 other locations - About 2 hrs to fix
          js/Service.js on lines 108..113
          js/Service.js on lines 114..119
          js/Service.js on lines 120..125
          js/Service.js on lines 132..137
          js/Service.js on lines 138..143
          js/Service.js on lines 144..149

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

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

                                  if (param.load) {
                                      logger.debug("Generating handler plugin on load (load)");
                                      plugin = {name: 'generatedHandlerSuccess', fn: param.load};
                                      plugin.scope = param.scope || plugin;
                                      ret.push(new HandlerSuccessPlugin(plugin));
          Severity: Major
          Found in js/Service.js and 6 other locations - About 2 hrs to fix
          js/Service.js on lines 108..113
          js/Service.js on lines 120..125
          js/Service.js on lines 126..131
          js/Service.js on lines 132..137
          js/Service.js on lines 138..143
          js/Service.js on lines 144..149

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

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

                                  if (param.onLoad) {
                                      logger.debug("Generating handler plugin on load (onLoad)");
                                      plugin = {name: 'generatedHandlerSuccess', fn: param.onLoad};
                                      plugin.scope = param.scope || plugin;
                                      ret.push(new HandlerSuccessPlugin(plugin));
          Severity: Major
          Found in js/Service.js and 6 other locations - About 2 hrs to fix
          js/Service.js on lines 108..113
          js/Service.js on lines 114..119
          js/Service.js on lines 120..125
          js/Service.js on lines 126..131
          js/Service.js on lines 138..143
          js/Service.js on lines 144..149

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

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

                                  if (param.success) {
                                      logger.debug("Generating handler plugin for load (success)");
                                      plugin = {name: 'generatedHandlerSuccess', fn: param.success};
                                      plugin.scope = param.scope || plugin;
                                      ret.push(new HandlerSuccessPlugin(plugin));
          Severity: Major
          Found in js/Service.js and 6 other locations - About 2 hrs to fix
          js/Service.js on lines 108..113
          js/Service.js on lines 114..119
          js/Service.js on lines 120..125
          js/Service.js on lines 126..131
          js/Service.js on lines 132..137
          js/Service.js on lines 144..149

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

          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

                  test: function (url) {
                      var ret = true, xhr;
                      try {
                          // try the lowest footprint synchronous request to specific url.
                          xhr = new XMLHttpRequest();
          Severity: Major
          Found in js/NativeXhrDataProvider.js and 1 other location - About 2 hrs to fix
          js/DojoXhrDataProvider.js on lines 21..32

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

          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

                      test: function (url) {
                          var ret = true, xhr;
                          try {
                              // try the lowest footprint synchronous request to specific url.
                              xhr = new XMLHttpRequest();
          Severity: Major
          Found in js/DojoXhrDataProvider.js and 1 other location - About 2 hrs to fix
          js/NativeXhrDataProvider.js on lines 38..49

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

          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

                  it("testOriginalLacksGeneric",  function () {
                      assert.isUndefined(origServiceCRUD.create);
                      assert.isUndefined(origServiceCRUD.read);
                      assert.isUndefined(origServiceCRUD.update);
                      assert.isUndefined(origServiceCRUD.remove);
          Severity: Major
          Found in test/TestDataProviderPlugin.js and 1 other location - About 1 hr to fix
          test/TestDataProviderPlugin.js on lines 38..43

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

          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

                  it("testGenericHasOriginal",  function () {
                      assert.isDefined(genericizedServiceCRUD.createModel);
                      assert.isDefined(genericizedServiceCRUD.readModel);
                      assert.isDefined(genericizedServiceCRUD.updateModel);
                      assert.isDefined(genericizedServiceCRUD.deleteModel);
          Severity: Major
          Found in test/TestDataProviderPlugin.js and 1 other location - About 1 hr to fix
          test/TestDataProviderPlugin.js on lines 54..59

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

          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

                      var urlPlug = new UrlPrefixPlugin({
                          pointcut: "*.*",
                          name: "addServiceRoot",
                          prefix: ""
                      }),
          Severity: Major
          Found in test/TestNativeXhrDataProvider.js and 1 other location - About 1 hr to fix
          test/TestNativeXhrDataProvider.js on lines 45..56

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

          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

                      var urlPlug = new UrlPrefixPlugin({
                          pointcut: "*.*",
                          name: "addServiceRoot",
                          prefix: ""
                      }),
          Severity: Major
          Found in test/TestNativeXhrDataProvider.js and 1 other location - About 1 hr to fix
          test/TestNativeXhrDataProvider.js on lines 71..82

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

          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 (util.isArray(writePayload)) {
                                  writePayload.forEach(function (item, idx) {
                                      intermediate = plugin.fn.call(plugin.scope || plugin, item, that);
                                      writePayload[idx] = intermediate || writePayload[idx];
                                  }, that);
          Severity: Major
          Found in js/ServiceMethod.js and 1 other location - About 1 hr to fix
          js/ServiceMethod.js on lines 240..248

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

          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