Function Jcrop
has a Cognitive Complexity of 267 (exceeds 5 allowed). Consider refactoring.
function Jcrop(obj, opt) {
let $img;
let xscale;
let yscale;
Function Jcrop
has 889 lines of code (exceeds 25 allowed). Consider refactoring.
function Jcrop(obj, opt) {
let $img;
let xscale;
let yscale;
File jquery.Jcrop.js
has 913 lines of code (exceeds 250 allowed). Consider refactoring.
* jquery.Jcrop.js v0.9.12
* jQuery Image Cropping Plugin - released under MIT License
* Author: Kelly Hallman <khallman@gmail.com>
* http://github.com/tapmodo/Jcrop
Function Coords
has 226 lines of code (exceeds 25 allowed). Consider refactoring.
const Coords = (function() {
let x1 = 0,
y1 = 0,
x2 = 0,
y2 = 0;
Function Selection
has 177 lines of code (exceeds 25 allowed). Consider refactoring.
const Selection = (function() {
let awake,
hdep = 370,
borders = {},
handle = {},
Function getFixed
has 84 lines of code (exceeds 25 allowed). Consider refactoring.
function getFixed() {
if (!options.aspectRatio) {
return getRect();
}
Function Tracker
has 64 lines of code (exceeds 25 allowed). Consider refactoring.
const Tracker = (function() {
let onMove = function () {
},
onDone = function () {
};
Function getRect
has 52 lines of code (exceeds 25 allowed). Consider refactoring.
function getRect() {
let xsize = x2 - x1,
ysize = y2 - y1,
delta;
Function dragmodeHandler
has 35 lines of code (exceeds 25 allowed). Consider refactoring.
function dragmodeHandler(mode, f) {
return function(pos) {
if (!options.aspectRatio) {
switch (mode) {
case 'e':
Function interfaceUpdate
has 33 lines of code (exceeds 25 allowed). Consider refactoring.
function interfaceUpdate(
alt
) {
if (alt) {
Selection.enableOnly();
Similar blocks of code found in 2 locations. Consider refactoring.
if (xx > x1) {
if (xx - x1 < min_x) {
xx = x1 + min_x;
} else if (xx - x1 > max_x) {
Similar blocks of code found in 2 locations. Consider refactoring.
} else if (xx < x1) {
if (x1 - xx < min_x) {
xx = x1 - min_x;
} else if (x1 - xx > max_x) {
Similar blocks of code found in 2 locations. Consider refactoring.
if (xmin / xscale && Math.abs(xsize) < xmin / xscale) {
x2 = xsize > 0 ? x1 + xmin / xscale : x1 - xmin / xscale;
}
Similar blocks of code found in 2 locations. Consider refactoring.
if (ymin / yscale && Math.abs(ysize) < ymin / yscale) {
y2 = ysize > 0 ? y1 + ymin / yscale : y1 - ymin / yscale;
}
Similar blocks of code found in 2 locations. Consider refactoring.
if (xx < 0) {
xx = 0;
h = Math.abs((xx - x1) / aspect);
yy = rh < 0 ? y1 - h : h + y1;
} else if (xx > boundx) {
Similar blocks of code found in 2 locations. Consider refactoring.
function createHandles(li) {
for (let i = 0; i < li.length; i++) {
handle[li[i]] = insertHandle(li[i]);
}
}
Similar blocks of code found in 2 locations. Consider refactoring.
function createDragbars(li) {
for (let i = 0; i < li.length; i++) {
dragbar[li[i]] = insertDragbar(li[i]);
}
}
Similar blocks of code found in 2 locations. Consider refactoring.
if (yy < 0) {
yy = 0;
w = Math.abs((yy - y1) * aspect);
xx = rw < 0 ? x1 - w : w + x1;
} else if (yy > boundy) {
Similar blocks of code found in 2 locations. Consider refactoring.
if (nw > w && w > 0) {
nw = w;
nh = (w / $obj.width()) * $obj.height();
}
Similar blocks of code found in 2 locations. Consider refactoring.
if (nh > h && h > 0) {
nh = h;
nw = (h / $obj.height()) * $obj.width();
}
Similar blocks of code found in 2 locations. Consider refactoring.
if (xx < 0) {
x1 -= xx;
xx = 0;
} else if (xx > boundx) {
x1 -= xx - boundx;
Similar blocks of code found in 2 locations. Consider refactoring.
if (yy < 0) {
y1 -= yy;
yy = 0;
} else if (yy > boundy) {
y1 -= yy - boundy;
Similar blocks of code found in 2 locations. Consider refactoring.
if (ylimit && Math.abs(ysize) > ylimit) {
y2 = ysize > 0 ? y1 + ylimit : y1 - ylimit;
}
Similar blocks of code found in 2 locations. Consider refactoring.
if (xlimit && Math.abs(xsize) > xlimit) {
x2 = xsize > 0 ? x1 + xlimit : x1 - xlimit;
}
There are no issues that match your filters.