OWASP/railsgoat

View on GitHub
app/assets/images/fonts/lte-ie7.js

Summary

Maintainability
F
3 days
Test Coverage

Function onload has 497 lines of code (exceeds 25 allowed). Consider refactoring.
Open

window.onload = function() {
    function addIcon(el, entity) {
        var html = el.innerHTML;
        el.innerHTML = '<span style="font-family: \'icomoon\'">' + entity + '</span>' + html;
    }
Severity: Major
Found in app/assets/images/fonts/lte-ie7.js - About 2 days to fix

    File lte-ie7.js has 499 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* Use this script if you need to support IE 7 and IE 6. */
    
    window.onload = function() {
        function addIcon(el, entity) {
            var html = el.innerHTML;
    Severity: Minor
    Found in app/assets/images/fonts/lte-ie7.js - About 1 day to fix

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

      window.onload = function() {
          function addIcon(el, entity) {
              var html = el.innerHTML;
              el.innerHTML = '<span style="font-family: \'icomoon\'">' + entity + '</span>' + html;
          }
      Severity: Minor
      Found in app/assets/images/fonts/lte-ie7.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

      There are no issues that match your filters.

      Category
      Status