nfroidure/svgicons2svgfont

View on GitHub

Showing 27 of 50 total issues

File Matrix.js has 531 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable no-undef */
/*!
  2D Transformation Matrix v2.7.5
  (c) Epistemex.com 2014-2018
  License: MIT
Severity: Major
Found in src/Matrix.js - About 1 day to fix

    prototype has 56 functions (exceeds 20 allowed). Consider refactoring.
    Open

    Matrix.prototype = {
      _getPX: function () {
        var lst = ['t', 'oT', 'msT', 'mozT', 'webkitT', 'khtmlT'],
          i = 0,
          p,
    Severity: Major
    Found in src/Matrix.js - About 1 day to fix

      Function _transform has 189 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _transform(svgIconStream, _unused, svgIconStreamCallback) {
          // Parsing each icons asynchronously
          const saxStream = Sax.createStream(true);
          const parents = [];
          const transformStack = [new Matrix()];
      Severity: Major
      Found in src/index.js - About 7 hrs to fix

        File index.js has 471 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* eslint-disable complexity,prefer-reflect,max-len,newline-after-var */
        /* eslint no-multi-str:0 */
        
        'use strict';
        
        
        Severity: Minor
        Found in src/index.js - About 7 hrs to fix

          Function _flush has 173 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            _flush(svgFontFlushCallback) {
              this.glyphs.forEach((glyph) => {
                if (
                  glyph.defaultHeight ||
                  glyph.defaultWidth ||
          Severity: Major
          Found in src/index.js - About 6 hrs to fix

            Function getMetadataService has 80 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function getMetadataService(options = {}) {
              let usedUnicodes = [];
            
              // Default options
              options.prependUnicode = !!options.prependUnicode;
            Severity: Major
            Found in src/metadata.js - About 3 hrs to fix

              Function getMetadataService has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
              Open

              function getMetadataService(options = {}) {
                let usedUnicodes = [];
              
                // Default options
                options.prependUnicode = !!options.prependUnicode;
              Severity: Minor
              Found in src/metadata.js - About 2 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 getMetadataFromFile has 66 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                return function getMetadataFromFile(file, cb) {
                  const basename = path.basename(file);
                  const metadata = {
                    path: file,
                    name: '',
              Severity: Major
              Found in src/metadata.js - About 2 hrs to fix

                Function fromTriangles has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Matrix.fromTriangles = function (t1, t2, context) {
                  var m1 = new Matrix(),
                    m2 = new Matrix(context),
                    r1,
                    r2,
                Severity: Major
                Found in src/Matrix.js - About 2 hrs to fix

                  Function decompose has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                    decompose: function (useLU) {
                      var me = this,
                        a = me.a,
                        b = me.b,
                        c = me.c,
                  Severity: Minor
                  Found in src/Matrix.js - About 2 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 decompose has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    decompose: function (useLU) {
                      var me = this,
                        a = me.a,
                        b = me.b,
                        c = me.c,
                  Severity: Minor
                  Found in src/Matrix.js - About 1 hr to fix

                    Function svgShapesToPathRectToPath has a Cognitive Complexity of 14 (exceeds 5 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

                    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 _flush has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                      _flush(svgFontFlushCallback) {
                        this.glyphs.forEach((glyph) => {
                          if (
                            glyph.defaultHeight ||
                            glyph.defaultWidth ||
                    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 from has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                    Matrix.from = function (a, b, c, d, e, f, context, dom) {
                      var m = new Matrix(context, dom),
                        scale,
                        dist,
                        q;
                    Severity: Minor
                    Found in src/Matrix.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 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

                        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 tagShouldRender has 28 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 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
                                Severity
                                Category
                                Status
                                Source
                                Language