nfroidure/svgicons2svgfont

View on GitHub

Showing 27 of 50 total issues

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

  _transform(svgIconStream, _unused, svgIconStreamCallback) {
    // Parsing each icons asynchronously
    const saxStream = Sax.createStream(true);
    const parents = [];
    const transformStack = [new Matrix()];
Severity: Minor
Found in src/index.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

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

function fileSorter(fileA, fileB) {
  const hasUnicodeA = testExpression.test(fileA);
  const hasUnicodeB = testExpression.test(fileB);

  if (hasUnicodeA == hasUnicodeB) {
Severity: Minor
Found in src/filesorter.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

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

  transform: function (a2, b2, c2, d2, e2, f2) {
Severity: Minor
Found in src/Matrix.js - About 45 mins to fix

    Avoid too many return statements within this function.
    Open

        return false;
    Severity: Major
    Found in src/index.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

        return fillVal;
      Severity: Major
      Found in src/index.js - About 30 mins to fix

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

          applyToArray: function (points) {
            var i = 0,
              p,
              l,
              mxPoints = [];
        Severity: Minor
        Found in src/Matrix.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

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

        function getTagColor(currTag, parents) {
          const defaultColor = 'black';
          const fillVal = currTag.attributes.fill;
          let color;
          const parentsLength = parents.length;
        Severity: Minor
        Found in src/index.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

        Severity
        Category
        Status
        Source
        Language