Showing 44 of 105 total issues
Function transform2matrix
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
transform2matrix : function(tstr, bbox){
var tdata = this.parseTransformString(tstr),
m = new Matrix;
if (tdata) {
for (var i = 0, ii = tdata.length; i < ii; i++) {
- 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
File svg.js
has 385 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
var fs = require('fs'),
xml2js = require('xml2js'),
_ = require('underscore'),
Function getInnerBox
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
Polygon.prototype.getInnerBox = function getInnerBox(callback) {
var verticesY = [],
pointsCount = this.points.length,
segments = [],
prevY = Infinity,
Function fromNode
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
module.exports.fromNode = function fromNode(object, node){
if(typeof node != 'undefined' && typeof node.$ != 'undefined'){
if(typeof node.$['class'] != 'undefined'){
object.setClassesFromString(node.$['class']);
}
- 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 transform2matrix
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
transform2matrix : function(tstr, bbox){
var tdata = this.parseTransformString(tstr),
m = new Matrix;
if (tdata) {
for (var i = 0, ii = tdata.length; i < ii; i++) {
File polygon.js
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var Matrix = require(__dirname + '/../matrix/extends'),
SvgObject = require(__dirname + '/svgobject'),
utils = require(__dirname + '/../matrix/utils'),
File svgobject.js
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
var _ = require('underscore'),
builder = require('xmlbuilder'),
async = require('async'),
Function getInnerBox
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Polygon.prototype.getInnerBox = function getInnerBox(callback) {
var verticesY = [],
pointsCount = this.points.length,
segments = [],
prevY = Infinity,
- 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 fromJson
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
module.exports.fromJson = function fromJson(object, json){
if(typeof json != 'undefined'){
if(typeof json.classes != 'undefined'){
object.classes = json.classes;
}
- 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 fromNode
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
module.exports.fromNode = function fromNode(node){
var text = new Text();
SvgObject.fromNode(text, node);
- 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 fromNode
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
module.exports.fromNode = function fromNode(node) {
var image = new Img();
if (typeof node !== 'undefined' && typeof node.$ !== 'undefined') {
SvgObject.fromNode(image, node);
- 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 _widestSegmentAtY
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Polygon.prototype._widestSegmentAtY = function _widestSegmentAtY(y) {
var segment = {
x : 0,
y : y,
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 fromNode
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
module.exports.fromNode = function fromNode(node){
var rect = new Rect();
if(typeof node != 'undefined' && typeof node.$ != 'undefined'){
SvgObject.fromNode(rect, node);
- 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 fromDxfFile
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.fromDxfFile = function fromDxfFile(params, callback) {
SvgParser.convertDxf(params, function (err, result) {
if (err) {
callback (err);
return;
Function contains
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
SvgObject.prototype.contains = function contains(svgObject, callback){
var self = this;
async.parallel({
ownBbox : function(c){
self.getBBox(function(bbox){
Function fromJson
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
module.exports.fromJson = function fromJson(json){
var rect = new Rect();
if(typeof json != 'undefined'){
SvgObject.fromJson(rect, json);
- 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 fromJson
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
module.exports.fromJson = function fromJson(json){
var image = new Img();
if (typeof json != 'undefined') {
SvgObject.fromJson(image, json);
- 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 _widestSegmentAtY
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Polygon.prototype._widestSegmentAtY = function _widestSegmentAtY(y) {
var segment = {
x : 0,
y : y,
width : 0
Function fromJson
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
module.exports.fromJson = function fromJson(json){
var text = new Text();
if(typeof json != 'undefined'){
SvgObject.fromJson(text, json);
- 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 calculateAllInnerBoxes
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Group.prototype.calculateAllInnerBoxes = function calculateAllInnerBoxes(callback) {
var group = new Group();
group.style = this.style;
group.classes = this.classes;
group.id = this.id;