Showing 9 of 16 total issues
Function drawGraph
has 309 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawGraph(orgName) {
var name = orgName
// Remove any existing graph
d3.select("#graph-container").select("svg").remove();
console.log("drawGraph Called");
Consider simplifying this complex logical expression. Open
} else if (d3CurrentEvent.keyCode>=48 && d3CurrentEvent.keyCode<=90 && !d3CurrentEvent.ctrlKey && !d3CurrentEvent.altKey && !d3CurrentEvent.metaKey) {
switch (String.fromCharCode(d3CurrentEvent.keyCode)) {
case "C": keyc = !keyc; break;
case "S": keys = !keys; break;
case "T": keyt = !keyt; break;
File network.js
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as d3 from "d3";
import {event as d3CurrentEvent} from 'd3';
function drawGraph(orgName) {
var name = orgName
Method index
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
set_org
data = Rails.cache.fetch @org
if !data.nil?
Function drawGraph
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function drawGraph(orgName) {
var name = orgName
// Remove any existing graph
d3.select("#graph-container").select("svg").remove();
console.log("drawGraph Called");
- 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
Method connected_members
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def connected_members(user_events)
connected = {}
members = organisation_members(params.fetch('organisation_name'))
repos = Set.new
# build list of repos and their contributors
- 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 keydown
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function keydown() {
if (d3CurrentEvent.keyCode==32) {
force.stop();
} else if (d3CurrentEvent.keyCode>=48 && d3CurrentEvent.keyCode<=90 && !d3CurrentEvent.ctrlKey && !d3CurrentEvent.altKey && !d3CurrentEvent.metaKey) {
switch (String.fromCharCode(d3CurrentEvent.keyCode)) {
Function draw
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function draw(data) {
var color = d3.scale.ordinal(d3.schemeSet2);
var width = 420,
barHeight = 20;
Method index
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def index
set_org
data = Rails.cache.fetch @org
if !data.nil?
- 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"