Showing 33 of 54 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
File index.js
has 516 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';
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,
Function _transform
has 177 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 defs = [];
Function _flush
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
_flush(svgFontFlushCallback) {
this.glyphs.forEach((glyph) => {
if (
glyph.defaultHeight ||
glyph.defaultWidth ||
Function getMetadataService
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getMetadataService(options = {}) {
let usedUnicodes = [];
// Default options
options.prependUnicode = !!options.prependUnicode;
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;
- Read upRead up
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: '',
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,
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,
- Read upRead up
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,
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;
- Read upRead up
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;
- Read upRead up
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 ||
- Read upRead up
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;
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
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
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(
- Read upRead up
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(
Function tagShouldRender
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function tagShouldRender(curTag, parents) {
let values;
return !parents.some((tag) => {
if (