ramirezcgn/svgicons2svgfont

View on GitHub

Showing 54 of 54 total issues

Function svgShapesToPathRectToPath has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function svgShapesToPathRectToPath(attributes) {
  const x = 'undefined' !== typeof attributes.x ? parseFloat(attributes.x) : 0;
  const y = 'undefined' !== typeof attributes.y ? parseFloat(attributes.y) : 0;
  const width =
    'undefined' !== typeof attributes.width ? parseFloat(attributes.width) : 0;
Severity: Minor
Found in src/svgshapes2svgpath.js - About 1 hr to fix

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

      _getFilesInfos(files) {
        let filesProcessed = 0;
    
        this.fileInfos = [];
        // Ensure prefixed files come first
    Severity: Minor
    Found in src/iconsdir.js - About 1 hr to fix

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

            r1 = [
              t1[0].x - rx1,
              t1[0].y - ry1,
              t1[1].x - rx1,
              t1[1].y - ry1,
      Severity: Major
      Found in src/Matrix.js and 1 other location - About 1 hr to fix
      src/Matrix.js on lines 108..115

      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

            r2 = [
              t2[0].x - rx2,
              t2[0].y - ry2,
              t2[1].x - rx2,
              t2[1].y - ry2,
      Severity: Major
      Found in src/Matrix.js and 1 other location - About 1 hr to fix
      src/Matrix.js on lines 100..107

      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

      Function svgShapesToPathCircleToPath has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function svgShapesToPathCircleToPath(attributes) {
        const cx = parseFloat(attributes.cx);
        const cy = parseFloat(attributes.cy);
        const rx =
          'undefined' !== typeof attributes.rx
      Severity: Minor
      Found in src/svgshapes2svgpath.js - About 1 hr to fix

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

          _processElement(tag, glyph, parents) {
            if ('rect' === tag.name && 'none' !== tag.attributes.fill) {
              return svgShapesToPath.rectToPath(tag.attributes);
            } else if ('line' === tag.name && 'none' !== tag.attributes.fill) {
              this.log(
        Severity: Minor
        Found in src/index.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 _processElement has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _processElement(tag, glyph, parents) {
            if ('rect' === tag.name && 'none' !== tag.attributes.fill) {
              return svgShapesToPath.rectToPath(tag.attributes);
            } else if ('line' === tag.name && 'none' !== tag.attributes.fill) {
              this.log(
        Severity: Minor
        Found in src/index.js - About 1 hr to fix

          Function tagShouldRender has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function tagShouldRender(curTag, parents) {
            let values;
          
            return !parents.some((tag) => {
              if (
          Severity: Minor
          Found in src/index.js - About 1 hr to fix

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

            Matrix.from = function (a, b, c, d, e, f, context, dom) {
            Severity: Major
            Found in src/Matrix.js - About 1 hr to fix

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

                _transform(svgIconStream, _unused, svgIconStreamCallback) {
                  // Parsing each icons asynchronously
                  const saxStream = Sax.createStream(true);
                  const parents = [];
                  const defs = [];
              Severity: Minor
              Found in src/index.js - About 55 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 setTransform has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                setTransform: function (a, b, c, d, e, f) {
              Severity: Minor
              Found in src/Matrix.js - About 45 mins to fix

                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

                  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

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

                          if (glyph.defaultHeight || this._options.usePathBounds) {
                            glyph.height = bounds.maxY - bounds.minY;
                          }
                  Severity: Minor
                  Found in src/index.js and 1 other location - About 35 mins to fix
                  src/index.js on lines 417..419

                  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

                        r2 = [t2[0] - rx2, t2[1] - ry2, t2[2] - rx2, t2[3] - ry2, rx2, ry2];
                  Severity: Minor
                  Found in src/Matrix.js and 1 other location - About 35 mins to fix
                  src/Matrix.js on lines 93..93

                  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

                        r1 = [t1[0] - rx1, t1[1] - ry1, t1[2] - rx1, t1[3] - ry1, rx1, ry1];
                  Severity: Minor
                  Found in src/Matrix.js and 1 other location - About 35 mins to fix
                  src/Matrix.js on lines 94..94

                  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 (glyph.defaultWidth || this._options.usePathBounds) {
                            glyph.width = bounds.maxX - bounds.minX;
                          }
                  Severity: Minor
                  Found in src/index.js and 1 other location - About 35 mins to fix
                  src/index.js on lines 414..416

                  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

                                  'Could not save codepoint: ' +
                                    'u' +
                                    metadata.unicode[0]
                                      .codePointAt(0)
                                      .toString(16)
                  Severity: Minor
                  Found in src/metadata.js and 1 other location - About 30 mins to fix
                  src/iconsdir.js on lines 41..48

                  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

                  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 svgShapesToPath.circleToPath(tag.attributes);
                    Severity: Major
                    Found in src/index.js - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language