Showing 47 of 93 total issues
Function TotalsEarnedChartViewModel
has 354 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function TotalsEarnedChartViewModel( params ) {
var self = this,
timeFormat = 'dddd, MMMM Do YYYY, h:mm:ss a',
localUtcOffset = moment().utcOffset();
Function WidgetBase
has 305 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function WidgetBase( params ) {
var self = this,
MAX_RETRIES = 3;
Function FraudGaugeViewModel
has 187 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function FraudGaugeViewModel( params ) {
WidgetBase.call( this, params );
var self = this,
Function XByYChartViewModel
has 180 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function XByYChartViewModel( params ) {
WidgetBase.call( this, params );
var self = this,
wasSaved = self.chartSaved(); // populateChoices() may overwrite
Function exports
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function ( req, res ) {
var widget = widgets[ req.params.widget ],
qs = urlParser.parse( req.url ).query,
parsedQs = querystringParser.parse( qs ),
substitutedQuery,
- 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 totals-earned-chart.js
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
define( [
'knockout',
'text!components/widgets/totals-earned-chart/totals-earned-chart.html',
'c3',
'numeraljs',
Function buildWhere
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
Open
function buildWhere( filterNode, widget, values, joins ) {
var col, colText, op, rightClause, leftClause, val, i, pattern, partial, ops = {
and: 'AND',
or: 'OR',
eq: '=',
- 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 processData
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.processData = function ( rawdata, timescale, grouping, timestamp ) {
var timeWord = ( timescale === 'Day' ? 'Dai' : timescale ) + 'ly',
totals,
counts,
Function ABTestingViewModel
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var ABTestingViewModel = function ( params ) {
var self = this;
self.title = 'A/B Test Results';
Function AppContent
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function AppContent() {
var self = this,
pages = [ 'Library', 'Profile', 'Home' ];
hasher.prependHash = '';
Function exports
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function ( req, res ) {
var widget = widgets[ req.params.widget ],
qs = urlParser.parse( req.url ).query,
parsedQs = querystringParser.parse( qs ),
substitutedQuery,
Function AmtPerSecondChartViewModel
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function AmtPerSecondChartViewModel( params ) {
var self = this;
WidgetBase.call( this, params );
self.hasData = ko.observable( false );
File widgetBase.js
has 320 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
define( [
'jquery',
'knockout',
'operators'
], function ( $, ko, ops ) {
Function buildWhere
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function buildWhere( filterNode, widget, values, joins ) {
var col, colText, op, rightClause, leftClause, val, i, pattern, partial, ops = {
and: 'AND',
or: 'OR',
eq: '=',
Function makeChart
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.makeChart = function () {
if ( params.sharedContext.dayObj.length < 2 ) {
return;
}
self.hasData( true );
Function makeChart
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.makeChart = function ( data ) {
var colors = {},
axes = {},
settings,
columns = [],
File data.js
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable no-console */
var widgets = require( '../widgets' ),
odataParser = require( 'odata-parser' ),
mysqlPromise = require( 'mysql-promise' )(),
config = require( '../config.js' ),
Function makeHourlyChart
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.makeHourlyChart = function ( d /* , i */ ) {
var hourlyData = params.sharedContext.dayObj[ d.x + 1 ],
hourlyCountArray = [ 'Hourly Count' ],
hourlyTotalArray = [ 'Hourly Total' ],
j;
Function NavBarViewModel
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function NavBarViewModel( params ) {
var self = this;
self.loggedIn = params.loggedIn;
self.welcome = params.welcome;
File common-filters.js
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Use these to extend() your widget's filters. Note that some filters are
* defined for multiple tables. Extend with the filter set of your primary
* table last to make sure you get the correct version.
*/