Function handleLine
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
function handleLine(commit, group) {
/*
This is the structure of the HTML fragment we are working
with:
- 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
File blame_incremental.js
has 361 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright (C) 2007, Fredrik Kuivinen <frekui@gmail.com>
// 2007, Petr Baudis <pasky@suse.cz>
// 2008-2011, Jakub Narebski <jnareb@gmail.com>
/**
Function handleLine
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
function handleLine(commit, group) {
/*
This is the structure of the HTML fragment we are working
with:
Function processBlameLines
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function processBlameLines(lines) {
var match;
for (var i = 0, len = lines.length; i < len; i++) {
- 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 processBlameLines
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processBlameLines(lines) {
var match;
for (var i = 0, len = lines.length; i < len; i++) {
Function handleResponse
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function handleResponse(xhr, fromTimer) {
/*
* xhr.readyState
*
Function handleResponse
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function handleResponse(xhr, fromTimer) {
/*
* xhr.readyState
*
- 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 fixColorsAndGroups
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function fixColorsAndGroups() {
var colorClasses = ['light', 'dark'];
var linenum = 1;
var tr, prev_group;
var colorClass = 0;
- 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 deeply nested control flow statements. Open
if (!('previous' in curCommit)) {
var parts = data.split(' ', 2);
curCommit.previous = parts[0];
curCommit.file_parent = unquote(parts[1]);
}
Avoid deeply nested control flow statements. Open
if (fragment) {
td_sha1.appendChild(fragment);
}
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return;
Function updateProgressInfo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function updateProgressInfo() {
if (!div_progress_info) {
div_progress_info = document.getElementById('progress_info');
}
if (!div_progress_bar) {
- 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 findColorNo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function findColorNo(tr_prev, tr_next) {
var color_prev = getColorNo(tr_prev);
var color_next = getColorNo(tr_next);
- 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"