XoopsModules25x/xoopsinfo

View on GitHub
phpsysinfo/js/vendor/transparency.js

Summary

Maintainability
F
1 wk
Test Coverage

File transparency.js has 639 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* ========================================================================
 * transparency.js v0.10.0
 * http://leonidas.github.io/transparency/
 * Licensed under MIT (https://github.com/leonidas/transparency/blob/master/LICENSE)
 * ======================================================================== */
Severity: Major
Found in phpsysinfo/js/vendor/transparency.js - About 1 day to fix

    Function 4 has 158 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    },{"./helpers":5,"./instance":6}],4:[function(require,module,exports){
    var AttributeFactory, Checkbox, Element, ElementFactory, Input, Radio, Select, TextArea, VoidElement, helpers, _,
      __hasProp = {}.hasOwnProperty,
      __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
    
    
    Severity: Major
    Found in phpsysinfo/js/vendor/transparency.js - About 6 hrs to fix

      Function 1 has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

      (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
      var $, Context, Transparency, helpers, _,
        __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
      
      _ = require('../lib/lodash.js');
      Severity: Minor
      Found in phpsysinfo/js/vendor/transparency.js - About 5 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 6 has 137 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      },{"./elementFactory":4}],6:[function(require,module,exports){
      var Instance, chainable, helpers, _,
        __hasProp = {}.hasOwnProperty;
      
      _ = require('../lib/lodash.js');
      Severity: Major
      Found in phpsysinfo/js/vendor/transparency.js - About 5 hrs to fix

        Function 2 has 123 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        },{"../lib/lodash.js":7,"./context":3,"./helpers":5}],2:[function(require,module,exports){
        var Attribute, AttributeFactory, BooleanAttribute, Class, Html, Text, helpers, _,
          __hasProp = {}.hasOwnProperty,
          __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
        
        
        Severity: Major
        Found in phpsysinfo/js/vendor/transparency.js - About 4 hrs to fix

          Function 5 has 76 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          },{"../lib/lodash.js":7,"./attributeFactory":2,"./helpers":5}],5:[function(require,module,exports){
          var ElementFactory, expando, html5Clone, _getElements;
          
          ElementFactory = require('./elementFactory');
          
          
          Severity: Major
          Found in phpsysinfo/js/vendor/transparency.js - About 3 hrs to fix

            Function 1 has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
            var $, Context, Transparency, helpers, _,
              __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
            
            _ = require('../lib/lodash.js');
            Severity: Major
            Found in phpsysinfo/js/vendor/transparency.js - About 2 hrs to fix

              Function e has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
              Severity: Minor
              Found in phpsysinfo/js/vendor/transparency.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 3 has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              },{"../lib/lodash":7,"./helpers":5}],3:[function(require,module,exports){
              var Context, Instance, after, before, chainable, cloneNode, _ref;
              
              _ref = require('./helpers'), before = _ref.before, after = _ref.after, chainable = _ref.chainable, cloneNode = _ref.cloneNode;
              
              
              Severity: Minor
              Found in phpsysinfo/js/vendor/transparency.js - About 1 hr to fix

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

                },{"../lib/lodash.js":7,"./attributeFactory":2,"./helpers":5}],5:[function(require,module,exports){
                var ElementFactory, expando, html5Clone, _getElements;
                
                ElementFactory = require('./elementFactory');
                
                
                Severity: Minor
                Found in phpsysinfo/js/vendor/transparency.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 7 has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                },{"../lib/lodash.js":7,"./helpers":5}],7:[function(require,module,exports){
                 var _ = {};
                
                _.toString = Object.prototype.toString;
                
                
                Severity: Minor
                Found in phpsysinfo/js/vendor/transparency.js - About 1 hr to fix

                  Function renderValues has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    Instance.prototype.renderValues = chainable(function(model, children) {
                      var element, key, value, _results;
                      if (_.isElement(model) && (element = this.elements[0])) {
                        return element.empty().el.appendChild(model);
                      } else if (typeof model === 'object') {
                  Severity: Minor
                  Found in phpsysinfo/js/vendor/transparency.js - About 1 hr to fix

                    Avoid deeply nested control flow statements.
                    Open

                                  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                                    element = _ref[_i];
                                    _results1.push(element.render(value));
                                  }
                    Severity: Major
                    Found in phpsysinfo/js/vendor/transparency.js - About 45 mins to fix

                      Function 4 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      },{"./helpers":5,"./instance":6}],4:[function(require,module,exports){
                      var AttributeFactory, Checkbox, Element, ElementFactory, Input, Radio, Select, TextArea, VoidElement, helpers, _,
                        __hasProp = {}.hasOwnProperty,
                        __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
                      
                      
                      Severity: Minor
                      Found in phpsysinfo/js/vendor/transparency.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

                      Avoid deeply nested control flow statements.
                      Open

                                } else if (typeof value === 'object') {
                                  _results.push(children.push(key));
                                } else {
                                  _results.push(void 0);
                                }
                      Severity: Major
                      Found in phpsysinfo/js/vendor/transparency.js - About 45 mins to fix

                        Function 2 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        },{"../lib/lodash.js":7,"./context":3,"./helpers":5}],2:[function(require,module,exports){
                        var Attribute, AttributeFactory, BooleanAttribute, Class, Html, Text, helpers, _,
                          __hasProp = {}.hasOwnProperty,
                          __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
                        
                        
                        Severity: Minor
                        Found in phpsysinfo/js/vendor/transparency.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

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

                          __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
                        Severity: Major
                        Found in phpsysinfo/js/vendor/transparency.js and 1 other location - About 4 hrs to fix
                        phpsysinfo/js/vendor/transparency.js on lines 83..83

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

                        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

                          __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
                        Severity: Major
                        Found in phpsysinfo/js/vendor/transparency.js and 1 other location - About 4 hrs to fix
                        phpsysinfo/js/vendor/transparency.js on lines 299..299

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

                        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 (_i = 0, _len = _ref.length; _i < _len; _i++) {
                              child = _ref[_i];
                              _results.push(this.el.appendChild(child));
                            }
                        Severity: Major
                        Found in phpsysinfo/js/vendor/transparency.js and 1 other location - About 1 hr to fix
                        phpsysinfo/js/vendor/transparency.js on lines 213..216

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

                        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 (_i = 0, _len = _ref.length; _i < _len; _i++) {
                              child = _ref[_i];
                              _results.push(this.el.appendChild(child));
                            }
                        Severity: Major
                        Found in phpsysinfo/js/vendor/transparency.js and 1 other location - About 1 hr to fix
                        phpsysinfo/js/vendor/transparency.js on lines 183..186

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

                        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

                                      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                                        element = _ref[_i];
                                        _results1.push(element.render(value));
                                      }
                        Severity: Major
                        Found in phpsysinfo/js/vendor/transparency.js and 1 other location - About 1 hr to fix
                        phpsysinfo/js/vendor/transparency.js on lines 628..631

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

                        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

                            for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                              node = _ref[_i];
                              _results.push(parent.appendChild(node));
                            }
                        Severity: Major
                        Found in phpsysinfo/js/vendor/transparency.js and 1 other location - About 1 hr to fix
                        phpsysinfo/js/vendor/transparency.js on lines 662..665

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

                        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

                        exports.after = function(decorator) {
                          return function(method) {
                            return function() {
                              method.apply(this, arguments);
                              return decorator.apply(this, arguments);
                        Severity: Major
                        Found in phpsysinfo/js/vendor/transparency.js and 1 other location - About 1 hr to fix
                        phpsysinfo/js/vendor/transparency.js on lines 508..515

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

                        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

                          for (_i = 0, _len = BOOLEAN_ATTRIBUTES.length; _i < _len; _i++) {
                            name = BOOLEAN_ATTRIBUTES[_i];
                            AttributeFactory.Attributes[name] = BooleanAttribute;
                          }
                        Severity: Major
                        Found in phpsysinfo/js/vendor/transparency.js and 1 other location - About 1 hr to fix
                        phpsysinfo/js/vendor/transparency.js on lines 430..433

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

                        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

                          for (_i = 0, _len = VOID_ELEMENTS.length; _i < _len; _i++) {
                            nodeName = VOID_ELEMENTS[_i];
                            ElementFactory.Elements[nodeName] = VoidElement;
                          }
                        Severity: Major
                        Found in phpsysinfo/js/vendor/transparency.js and 1 other location - About 1 hr to fix
                        phpsysinfo/js/vendor/transparency.js on lines 121..124

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

                        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

                        exports.before = function(decorator) {
                          return function(method) {
                            return function() {
                              decorator.apply(this, arguments);
                              return method.apply(this, arguments);
                        Severity: Major
                        Found in phpsysinfo/js/vendor/transparency.js and 1 other location - About 1 hr to fix
                        phpsysinfo/js/vendor/transparency.js on lines 517..524

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

                        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