DRY and style issues
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
JessyInk |
New
|
Undecided
|
Unassigned |
Bug Description
Several issues are reported by Code Climate regarding duplicate code and styling issues. It may be nice to fix these.
* https:/
* https:/
For posterity, the issues are copy/pasted below:
=======
share/extension
Similar code found in two :function_
inkscape-
inkscape-
Expected '===' and instead saw '=='. (Line 28)
if (elems[
Expected '{' and instead saw 'jessyInk_
jessyInk_
The object literal notation {} is preferable. (Line 45)
var handlerDictio = new Object();
The object literal notation {} is preferable. (Line 47)
handlerDictio[
Missing semicolon. (Line 51)
}
'SLIDE_MODE' is not defined. (Line 47)
handlerDictio[
'SLIDE_MODE' is not defined. (Line 48)
handlerDictio[
'MOUSE_DOWN' is not defined. (Line 48)
handlerDictio[
===============
share/extension
Complex method .mouseclick (complexity = 26)
obj.mouseclick = function (e)
{
var elem = obj.getAdHocVie
View more
Complex method .rectToMatrix (complexity = 24)
obj.
{
rectWidth = rect.getBBox(
rectHeight = rect.getBBox(
rectX = rect.getBBox().x;
View more
Identical code found in two :block_statement nodes (mass*2 = 724)
inkscape-
inkscape-
Identical code found in two :if_statement nodes (mass*2 = 220)
inkscape-
inkscape-
Similar code found in two :function_
inkscape-
inkscape-
Similar code found in three :logical_expression nodes (mass = 84)
inkscape-
inkscape-
inkscape-
Expected '===' and instead saw '=='. (Line 28)
if (elems[
Expected '{' and instead saw 'jessyInk_
jessyInk_
Expected an assignment or function call and instead saw an expression. (Line 40)
obj.dragging_last;
The object literal notation {} is preferable. (Line 54)
var handlerDictio = new Object();
The object literal notation {} is preferable. (Line 56)
handlerDictio[
Missing semicolon. (Line 63)
}
['viewGroup'] is better written in dot notation. (Line 71)
var elem = obj.getAdHocVie
The array literal notation [] is preferable. (Line 75)
effectArray = new Array();
The object literal notation {} is preferable. (Line 77)
effectArray[0] = new Object();
['effect'] is better written in dot notation. (Line 78)
effectArray[
['dir'] is better written in dot notation. (Line 79)
effectArray[
['element'] is better written in dot notation. (Line 80)
effectArray[
['viewGroup'] is better written in dot notation. (Line 80)
effectArray[
['options'] is better written in dot notation. (Line 81)
effectArray[
The object literal notation {} is preferable. (Line 81)
effectArray[
['options'] is better written in dot notation. (Line 82)
effectArray[
['length'] is better written in dot notation. (Line 82)
effectArray[
Expected '===' and instead saw '=='. (Line 84)
if (elem == null)
Expected '{' and instead saw 'effectArray'. (Line 85)
effectArray[
['options'] is better written in dot notation. (Line 85)
effectArray[
['matrixNew'] is better written in dot notation. (Line 85)
effectArray[
A constructor name should start with an uppercase letter. (Line 85)
effectArray[
Expected '{' and instead saw 'effectArray'. (Line 87)
effectArray[
['options'] is better written in dot notation. (Line 87)
effectArray[
['matrixNew'] is better written in dot notation. (Line 87)
effectArray[
A constructor name should start with an uppercase letter. (Line 87)
effectArray[
A constructor name should start with an uppercase letter. (Line 87)
effectArray[
Missing semicolon. (Line 95)
}
['element'] is better written in dot notation. (Line 123)
var screenPointList = obj.projectRect
Expected '{' and instead saw 'return'. (Line 126)
return children[counter];
Expected '!==' and instead saw '!='. (Line 130)
if (child != null)
Expected '{' and instead saw 'return'. (Line 131)
return child;
Missing semicolon. (Line 136)
}
Missing semicolon. (Line 167)
}
A constructor name should start with an uppercase letter. (Line 181)
var matrixOrig = (new matrixSVG(
A constructor name should start with an uppercase letter. (Line 182)
var matrixProj = (new matrixSVG(
The array literal notation [] is preferable. (Line 188)
var subPnts = new Array();
Expected '{' and instead saw 'subPnts'. (Line 193)
subPnts[pntCounter] = pnts[blockCounter * 3.0 + pntCounter];
A constructor name should start with an uppercase letter. (Line 205)
var matrixPnt = (new matrixSVG)
Missing '()' invoking a constructor. (Line 205)
var matrixPnt = (new matrixSVG)
'pntCounter' is already defined. (Line 208)
for (var pntCounter = 0; pntCounter < 3.0; pntCounter++)
Expected '===' and instead saw '=='. (Line 212)
if ((pntCounter == 0) && !((matrixTrans.e11 > 0.01) && (matrixTrans.e11 < 0.99) && (matrixTrans.e21 > 0.01) && (matrixTrans.e21 < 0.99)))
Expected '{' and instead saw 'return'. (Line 213)
return false;
Expected '===' and instead saw '=='. (Line 214)
else if ((pntCounter == 1) && !((matrixTrans.e12 > 0.01) && (matrixTrans.e12 < 0.99) && (matrixTrans.e22 > 0.01) && (matrixTrans.e22 < 0.99)))
Expected '{' and instead saw 'return'. (Line 215)
return false;
Expected '===' and instead saw '=='. (Line 216)
else if ((pntCounter == 2) && !((matrixTrans.e13 > 0.01) && (matrixTrans.e13 < 0.99) && (matrixTrans.e23 > 0.01) && (matrixTrans.e23 < 0.99)))
Expected '{' and instead saw 'return'. (Line 217)
return false;
Missing semicolon. (Line 223)
}
Expected '{' and instead saw 'return'. (Line 234)
return false;
A constructor name should start with an uppercase letter. (Line 242)
var matrix = (new matrixSVG(
Too many errors. (55% scanned). (Line 242)
var matrix = (new matrixSVG(