Showing 149 of 317 total issues
Avoid deeply nested control flow statements. Open
Open
for (j = i + 1; j < n; ++j) q[j].i -= 2;
Function d3_geom_quadtreeVisit
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function d3_geom_quadtreeVisit(f, node, x1, y1, x2, y2) {
Avoid deeply nested control flow statements. Open
Open
if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ;
Avoid deeply nested control flow statements. Open
Open
if (subnode = subnodes[k]) d3_transitionNode(subnode, k, id, transition);
Avoid deeply nested control flow statements. Open
Open
for (j = i + 1; j < n; ++j) q[j].i--;
Consider simplifying this complex logical expression. Open
Open
if (abs(x3 - x2) > ε || abs(y3 - y2) > ε) {
halfEdges.splice(iHalfEdge, 0, new d3_geom_voronoiHalfEdge(d3_geom_voronoiCreateBorderEdge(cell.site, end, abs(x3 - x0) < ε && y1 - y3 > ε ? {
x: x0,
y: abs(x2 - x0) < ε ? y2 : y1
} : abs(y3 - y1) < ε && x1 - x3 > ε ? {
Function updateTaskCard
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
updateTaskCard = function(container, task_card, hours, devs, me) {
Function quadtree
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
d3.geom.quadtree = function(points, x1, y1, x2, y2) {
Function drawBurndown
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
drawBurndown = function(startDate, endDate, spRemaining, spComplete, spHours) {
Function d3_geo_clipPolygon
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener) {
Method search_by_query
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def search_by_query(search_query, page, project_id, all_sprints = false)
raise ArgumentError unless project_id
search(per_page: 100, page: page, load: true) do |search|
search.query do |query|
query.filtered do |f|
- 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
Avoid too many return
statements within this function. Open
Open
return (rfocx + lfocx) / 2;
Avoid too many return
statements within this function. Open
Open
if (r < t0) return;
Avoid too many return
statements within this function. Open
Open
if (r < t0) return;
Avoid too many return
statements within this function. Open
Open
}; else if (va.y >= y1) return;
Avoid too many return
statements within this function. Open
Open
if (r > t1) return;
Avoid too many return
statements within this function. Open
Open
if (r > t1) return;
Avoid too many return
statements within this function. Open
Open
if (r < t0) return;
Avoid too many return
statements within this function. Open
Open
}; else if (va.y < y0) return;
Avoid too many return
statements within this function. Open
Open
}; else if (va.x >= x1) return;