Showing 32 of 857 total issues
Function setColor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.page.setColor = function(color) {
var complements = {
"#333333": "#222222",
"#990f0f": "#880e0e",
"#0f993b": "#0e882a",
Avoid deeply nested control flow statements. Open
for (var wordIndex in titles.words) {
var title = titles.words[wordIndex];
if (title == "subjectName") {
title = subjectName;
}
Function sendFeedback
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
window.page.sendFeedback = function(type, msg, name, username, webpage, callback) {
Consider simplifying this complex logical expression. Open
if (tag.toLowerCase() == "test" || tag.toLowerCase() == "exam" || tag.toLowerCase() == "midterm" || tag.toLowerCase() == "quiz" || tag.toLowerCase() == "ica" || tag.toLowerCase() == "lab") {
keyword = "on";
}
Function request
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
roux.request = function(key, action, data, errCallback, callback) {
Function setEvent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
window.planner.setEvent = function(date, subjectIndex, text, done, subId) {
Function sendEmail
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var sendEmail = function(templateName, to, templateObjs, done, err) {
Function HWphrase
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
window.overview.HWphrase = function (id, hw) {
if(hw < 1){
document.getElementById(id).innerHTML = '<i class="fa fa-smile-o"></i> Looks like tonight will be an easy night! You have no homework due tomorrow!';
} else if (hw < 3) {
if (hw === 1){
- 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 parseText
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
parseText: function(text) {
var prefixes = window.utils.getPrefixes();
var flatPrefixes = window.utils.getFlatPrefixes();
var retObj = {
what: undefined,
- 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
return;
Function getAnnouncement
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
window.planner.getAnnouncement = function(date, callback) {
window.api.get("planner/announcements/get/" + date, function(data) {
if (data.status == "ok") {
if (data.announcement !== null) {
callback(data.announcement, date);
- 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 getPrefixClass
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
window.utils.getPrefixClass = function(prefix) {
var chkPrefix = prefix.toLowerCase();
var prefixes = window.utils.getPrefixes();
for (var prefixIndex in prefixes) {
for (var wordIndex in prefixes[prefixIndex].words) {
- 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"