Showing 840 of 1,637 total issues
Function update
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
update: function(e) {
e = e || this.lastEvent;
if (!e) return;
this.lastEvent = e;
Function setMatcher
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
if ( postFilter && !postFilter[ expando ] ) {
postFilter = setMatcher( postFilter );
}
if ( postFinder && !postFinder[ expando ] ) {
Function bounce
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.effects.effect.bounce = function( o, done ) {
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
// defaults:
Function voronoi
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
d3.geom.voronoi = function(points) {
var x = d3_geom_pointX, y = d3_geom_pointY, fx = x, fy = y, clipExtent = d3_geom_voronoiClipExtent;
if (points) return voronoi(points);
function voronoi(data) {
var polygons = new Array(data.length), x0 = clipExtent[0][0], y0 = clipExtent[0][1], x1 = clipExtent[1][0], y1 = clipExtent[1][1];
Function relayout
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function relayout() {
var subgroups = {}, groupSums = [], groupIndex = d3.range(n), subgroupIndex = [], k, x, x0, i, j;
chords = [];
groups = [];
k = 0, i = -1;
Function d3_interpolateString
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function d3_interpolateString(a, b) {
var m, i, j, s0 = 0, s1 = 0, s = [], q = [], n, o;
a = a + "", b = b + "";
d3_interpolate_number.lastIndex = 0;
for (i = 0; m = d3_interpolate_number.exec(b); ++i) {
Function superMatcher
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
superMatcher = function( seed, context, xml, results, expandContext ) {
var elem, j, matcher,
setMatched = [],
matchedCount = 0,
i = "0",
Function getCurrentRegionTooltip
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getCurrentRegionTooltip: function () {
var options = this.options,
header = '',
entries = [],
fields, formats, formatlen, fclass, text, i,
Function d3_layout_packSiblings
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function d3_layout_packSiblings(node) {
if (!(nodes = node.children) || !(n = nodes.length)) return;
var nodes, xMin = Infinity, xMax = -Infinity, yMin = Infinity, yMax = -Infinity, a, b, c, i, j, k, n;
function bound(node) {
xMin = Math.min(node.x - node.r, xMin);
Function _showDatepicker
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_showDatepicker: function(input) {
input = input.target || input;
if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
input = $("input", input.parentNode)[0];
}
Function nest
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
d3.nest = function() {
var nest = {}, keys = [], sortKeys = [], sortValues, rollup;
function map(mapType, array, depth) {
if (depth >= keys.length) return rollup ? rollup.call(nest, array) : sortValues ? array.sort(sortValues) : array;
var i = -1, n = array.length, key = keys[depth++], keyValue, object, setter, valuesByKey = new d3_Map(), values;
Function _run
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
def _run(self):
result = StatusCheckResult(check=self)
try:
status = get_job_status(self.name)
active = status['active']
- 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 drag
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
drag: function(event, ui) {
var ts, bs, ls, rs, l, r, t, b, i, first,
inst = $(this).data("ui-draggable"),
o = inst.options,
Function drag
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
drag: function(event, ui) {
var inst = $(this).data("ui-draggable"), that = this;
$.each(inst.sortables, function() {
Function _fnFeatureHtmlLength
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnFeatureHtmlLength ( oSettings )
{
if ( oSettings.oScroll.bInfinite )
{
return null;
Function _fnDrawHead
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnDrawHead( oSettings, aoSource, bIncludeHidden )
{
var i, iLen, j, jLen, k, kLen, n, nLocalTr;
var aoLocal = [];
var aApplied = [];
Function attr
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
elproto.attr = function (name, value) {
if (this.removed) {
return this;
}
if (name == null) {
Function Deferred
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Deferred: function( func ) {
var tuples = [
// action, add listener, listener list, final state
[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
Function explode
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.effects.effect.explode = function( o, done ) {
var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3,
cells = rows,
el = $( this ),
Function clipLine
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function clipLine(listener) {
var point0, c0, v0, v00, clean;
return {
lineStart: function() {
v00 = v0 = false;