File webappClientController.js
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*jshint bitwise: true */
/*jslint bitwise: true */
/*global $:false, Spinner:false, ActiveXObject:false*/
/**
Function createTableBody
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function createTableBody(data){
"use strict";
var tbody, propertyName, row, index, td;
tbody = document.createElement('tbody');
for (index in data.data.rows){
- 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 processOk
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processOk(request,responseText,subtitle){
"use strict";
var data;
try {
data=JSON.parse(responseText);
Function processFail
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function processFail(request,responseText,status,subtitle){
"use strict";
var data, response;
if(
status === 404 &&
- 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 createTableBody
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createTableBody(data){
"use strict";
var tbody, propertyName, row, index, td;
tbody = document.createElement('tbody');
for (index in data.data.rows){
Function processOk
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function processOk(request,responseText,subtitle){
"use strict";
var data;
try {
data=JSON.parse(responseText);
- 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 requestAndProcessPageJSONData
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function requestAndProcessPageJSONData(request){
"use strict";
var xmlhttp, //intervalID = window.setInterval(processingDots,1000),
spinnerSettings, spinner, params, subtitle;
if (request.hasOwnProperty('subtitle')){
Function processFail
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processFail(request,responseText,status,subtitle){
"use strict";
var data, response;
if(
status === 404 &&
Function formatDateTimeString
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function formatDateTimeString(dateTimeString){
"use strict";
var dateParts = dateTimeString.split(' '),
timeParts = dateParts[1].split(':'),
dateDateParts = dateParts[0].split('-'),
Function requestAndProcessPageJSONData
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function requestAndProcessPageJSONData(request){
"use strict";
var xmlhttp, //intervalID = window.setInterval(processingDots,1000),
spinnerSettings, spinner, params, subtitle;
if (request.hasOwnProperty('subtitle')){
- 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 (typeof data.data.rows[index][propertyName] !== 'undefined') {
//noinspection JSUnfilteredForInLoop
switch (data.data.columns[propertyName]){
case 'raffleid':
//noinspection JSUnfilteredForInLoop