Rominou34/soft-css

View on GitHub

Showing 2,566 of 2,566 total issues

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

function Papillon() {

  /*
  * An array containing the notifications ( used so they can pile up without
  * covering each other )
Severity: Minor
Found in src/js/papillon.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 Papillon has 97 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Papillon() {

  /*
  * An array containing the notifications ( used so they can pile up without
  * covering each other )
Severity: Major
Found in src/js/papillon.js - About 3 hrs to fix

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

            if(tip.classList.contains('bottom')) {
              tip.style.bottom = "-" + (h+15) + "px";
              tip.style.left = (elW/2 - w/2) + "px";
            }
    Severity: Major
    Found in src/js/dom.js and 2 other locations - About 2 hrs to fix
    src/js/dom.js on lines 84..87
    src/js/dom.js on lines 92..95

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

            if(tip.classList.contains('right')) {
              tip.style.right = "-" + (w+15) + "px";
              tip.style.top = (elH/2 - h/2) + "px";
            }
    Severity: Major
    Found in src/js/dom.js and 2 other locations - About 2 hrs to fix
    src/js/dom.js on lines 88..91
    src/js/dom.js on lines 92..95

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

            if(tip.classList.contains('left')) {
              tip.style.left = "-" + (w+15) + "px";
              tip.style.top = (elH/2 - h/2) + "px";
            }
    Severity: Major
    Found in src/js/dom.js and 2 other locations - About 2 hrs to fix
    src/js/dom.js on lines 84..87
    src/js/dom.js on lines 88..91

    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

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

    var addToolTipListeners = function() {
      var toolTips = document.querySelectorAll(".soft-tooltip");
      var toolTipItems = [].slice.call(toolTips);
      toolTipItems.forEach(function (item) {
        //Event listener for hover
    Severity: Minor
    Found in src/js/dom.js - About 1 hr to fix

      Function old_notif has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        this.old_notif = function(type, msg, t) {
          var not = document.createElement("div");
          var id = randomId(8);
          not.className = "soft-notif " + type;
          not.innerHTML = msg;
      Severity: Minor
      Found in src/js/papillon.js - About 1 hr to fix

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

        window.onload = function() {
          // Add event listeners to display tooltips on hover
          addToolTipListeners();
        
          // Add event listeners to display dropdown menus on action
        Severity: Minor
        Found in src/js/dom.js - About 1 hr to fix

          Function animateStep has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            this.animateStep = function(timestamp, start, el, prop, st, en, un, dur) {
          Severity: Major
          Found in src/js/papillon.js - About 1 hr to fix

            Function softRequestAnimationFrame has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                window.softRequestAnimationFrame = function(callback, startTime, element, property, start, end, unit, duration) {
            Severity: Major
            Found in src/js/misc.js - About 1 hr to fix

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

                if(inp.checkValidity()) {
                  if(inp.classList.contains("invalid")) {
                    inp.classList.remove("invalid");
                  }
                  inp.classList.add("valid");
              Severity: Minor
              Found in src/js/dom.js and 1 other location - About 50 mins to fix
              src/js/dom.js on lines 128..133

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

              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

                } else {
                  if(inp.classList.contains("valid")) {
                    inp.classList.remove("valid");
                  }
                  inp.classList.add("invalid");
              Severity: Minor
              Found in src/js/dom.js and 1 other location - About 50 mins to fix
              src/js/dom.js on lines 123..128

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

              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

              Avoid deeply nested control flow statements.
              Open

                          if(notifs[j][1]===i) {
                            b=true;
                          }
              Severity: Major
              Found in src/js/papillon.js - About 45 mins to fix

                Function animate has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  this.animate = function(el, prop, st, en, un, dura) {
                Severity: Minor
                Found in src/js/papillon.js - About 45 mins to fix

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

                  var inputValidate = function(inp) {
                    if(inp.checkValidity()) {
                      if(inp.classList.contains("invalid")) {
                        inp.classList.remove("invalid");
                      }
                  Severity: Minor
                  Found in src/js/dom.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

                  The box-sizing property isn't supported in IE6 and IE7.
                  Open

                    box-sizing: inherit; }
                  Severity: Minor
                  Found in src/min/papillon.min.css by csslint

                  Unqualified attribute selectors are known to be slow.
                  Open

                  [hidden][aria-hidden="false"]:focus {
                  Severity: Minor
                  Found in src/min/papillon.min.css by csslint

                  Unqualified attribute selectors are known to be slow.
                  Open

                  [type="number"],
                  Severity: Minor
                  Found in src/min/papillon.min.css by csslint

                  Fallback background-color (hex or RGB) should precede RGBA background-color.
                  Open

                    background-color: rgba(69, 134, 232, 0.1);
                  Severity: Minor
                  Found in src/min/papillon.min.css by csslint

                  Rule doesn't have all its properties in alphabetical order.
                  Open

                  body > header > small {
                  Severity: Minor
                  Found in src/min/papillon.min.css by csslint
                  Severity
                  Category
                  Status
                  Source
                  Language