XoopsModules25x/xoopsinfo

View on GitHub
phpsysinfo/js/vendor/bootstrap-ie8.js

Summary

Maintainability
F
1 wk
Test Coverage

File bootstrap-ie8.js has 561 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* Bootstrap 4 for IE8 - v4.3.100          */
/* https://github.com/namiltd/bootstrap-ie */

// create the nodeType constants if the Node object is not defined
if (!window.Node){
Severity: Major
Found in phpsysinfo/js/vendor/bootstrap-ie8.js - About 1 day to fix

    Function applyMedia has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            applyMedia = function (fromResize) {
                var name = "clientWidth",
                    docElemProp = docElem[name],
                    currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[name] || docElemProp,
                    styleBlocks = {},
    Severity: Major
    Found in phpsysinfo/js/vendor/bootstrap-ie8.js - About 2 hrs to fix

      Function get has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          get:function(){
              var element=this,domTokenList=(element.getAttribute('class')||'').replace(/^\s+|\s$/g,'').split(/\s+/g);
              if (domTokenList[0]==='') domTokenList.splice(0,1);
              function setClass(){
                  if (domTokenList.length > 0) element.setAttribute('class', domTokenList.join(' '));
      Severity: Minor
      Found in phpsysinfo/js/vendor/bootstrap-ie8.js - About 1 hr to fix

        Function translate has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                translate = function (styles, href, media) {
                    var qs = styles.replace(respond.regex.comments, "")
                            .replace(respond.regex.keyframes, "")
                            .match(respond.regex.media),
                        ql = qs && qs.length || 0;
        Severity: Minor
        Found in phpsysinfo/js/vendor/bootstrap-ie8.js - About 1 hr to fix

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

              replaceCSS: function (cssText) {
                  if (cssText) {
                      // Replace all properties containing REM units with their pixel equivalents.
                      return cssText.replace(
                          /([\d]+\.[\d]+|\.[\d]+|[\d]+)rem/g, function (fullMatch, groupMatch) {
          Severity: Minor
          Found in phpsysinfo/js/vendor/bootstrap-ie8.js - About 1 hr to fix

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

                implement: function (linkElement) {
                    if (!linkElement.href) {
                        return;
                    }
            
            
            Severity: Minor
            Found in phpsysinfo/js/vendor/bootstrap-ie8.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 getEmValue has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    getEmValue = function () {
                        var ret,
                            div = doc.createElement('div'),
                            body = doc.body,
                            originalHTMLFontSize = docElem.style.fontSize,
            Severity: Minor
            Found in phpsysinfo/js/vendor/bootstrap-ie8.js - About 1 hr to fix

              Function implement has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  implement: function (linkElement) {
                      if (!linkElement.href) {
                          return;
                      }
              
              
              Severity: Minor
              Found in phpsysinfo/js/vendor/bootstrap-ie8.js - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                                    if (!thisstyle.hasquery || (!minnull || !maxnull) && (minnull || currWidth >= min) && (maxnull || currWidth <= max)) {
                                        if (!styleBlocks[thisstyle.media]) {
                                            styleBlocks[thisstyle.media] = [];
                                        }
                                        styleBlocks[thisstyle.media].push(rules[thisstyle.rules]);
                Severity: Major
                Found in phpsysinfo/js/vendor/bootstrap-ie8.js - About 1 hr to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if (href.substring(0, 2) === "//") {
                                                  href = w.location.protocol + href;
                                              }
                  Severity: Major
                  Found in phpsysinfo/js/vendor/bootstrap-ie8.js - About 45 mins to fix

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

                        replaceCSS: function (cssText) {
                            if (cssText) {
                                // Replace all properties containing REM units with their pixel equivalents.
                                return cssText.replace(
                                    /([\d]+\.[\d]+|\.[\d]+|[\d]+)rem/g, function (fullMatch, groupMatch) {
                    Severity: Minor
                    Found in phpsysinfo/js/vendor/bootstrap-ie8.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

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

                    (function() {
                      Object.defineProperty(Element.prototype, 'classList', {
                        get:function(){
                            var element=this,domTokenList=(element.getAttribute('class')||'').replace(/^\s+|\s$/g,'').split(/\s+/g);
                            if (domTokenList[0]==='') domTokenList.splice(0,1);
                    Severity: Major
                    Found in phpsysinfo/js/vendor/bootstrap-ie8.js and 1 other location - About 3 days to fix
                    phpsysinfo/js/vendor/bootstrap-ie9.js on lines 16..64

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

                    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

                        implement: function (linkElement) {
                            if (!linkElement.href) {
                                return;
                            }
                    
                    
                    Severity: Major
                    Found in phpsysinfo/js/vendor/bootstrap-ie8.js and 1 other location - About 1 day to fix
                    phpsysinfo/js/vendor/bootstrap-ie9.js on lines 94..127

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

                    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 (Object.prototype.__defineSetter__ && ('set' in desc)) {
                                    Object.prototype.__defineSetter__.call(o, prop, desc.set);
                                }
                    Severity: Minor
                    Found in phpsysinfo/js/vendor/bootstrap-ie8.js and 1 other location - About 40 mins to fix
                    phpsysinfo/js/vendor/bootstrap-ie8.js on lines 77..79

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

                    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 (Object.prototype.__defineGetter__ && ('get' in desc)) {
                                    Object.prototype.__defineGetter__.call(o, prop, desc.get);
                                }
                    Severity: Minor
                    Found in phpsysinfo/js/vendor/bootstrap-ie8.js and 1 other location - About 40 mins to fix
                    phpsysinfo/js/vendor/bootstrap-ie8.js on lines 80..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 48.

                    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 (!!max) {
                                            max = parseFloat(max) * (max.indexOf(em) > -1 ? ( eminpx || getEmValue() ) : 1);
                                        }
                    Severity: Minor
                    Found in phpsysinfo/js/vendor/bootstrap-ie8.js and 1 other location - About 35 mins to fix
                    phpsysinfo/js/vendor/bootstrap-ie8.js on lines 542..544

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

                    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 (!!min) {
                                            min = parseFloat(min) * (min.indexOf(em) > -1 ? ( eminpx || getEmValue() ) : 1);
                                        }
                    Severity: Minor
                    Found in phpsysinfo/js/vendor/bootstrap-ie8.js and 1 other location - About 35 mins to fix
                    phpsysinfo/js/vendor/bootstrap-ie8.js on lines 545..547

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

                    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

                                            minw: thisq.match(respond.regex.minw) && parseFloat(RegExp.$1) + (RegExp.$2 || ""),
                    Severity: Minor
                    Found in phpsysinfo/js/vendor/bootstrap-ie8.js and 1 other location - About 30 mins to fix
                    phpsysinfo/js/vendor/bootstrap-ie8.js on lines 631..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 45.

                    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

                                            maxw: thisq.match(respond.regex.maxw) && parseFloat(RegExp.$1) + (RegExp.$2 || "")
                    Severity: Minor
                    Found in phpsysinfo/js/vendor/bootstrap-ie8.js and 1 other location - About 30 mins to fix
                    phpsysinfo/js/vendor/bootstrap-ie8.js on lines 630..630

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

                    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