Showing 90 of 154 total issues
Function resizeImage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
formExplainer.resizeImage = function( els, $window, windowResize ) {
var pageWidth = els.$page.width();
var $image = els.$imageMapImage;
var currentHeight = $image.height();
- 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 positionNotes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function positionNotes( animating, expandable ) {
var $notes = $( '.educational-note div' );
// Check that we're on desktop
if ( $notes.css( 'position' ) === 'absolute' ) {
- 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 fitAndStickToWindow
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
formExplainer.fitAndStickToWindow = function( els, pageNum ) {
// http://stackoverflow.com/questions/318630/get-real-image-width-and-height-with-javascript-in-safari-chrome
$( '<img/>' )
.load( function() {
// store image width for use in calculations on window resize
- 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 _getStorageType
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function _getStorageType( storage ) {
// Use default setting if none is provided.
if ( typeof storage !== 'object' ) {
if ( typeof _storage === 'undefined' ) {
try {
- 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 render
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
render: function () {
var note,
noteHtml,
rowType,
prop = this.props.prop,
- 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 getState
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports.getState = function( options, callback ) {
if ( !window.navigator.geolocation ) {
var closestState = { name: 'AL' };
return closestState;
- 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 processRatesData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
processRatesData: function( data ) {
// data: [rate: frequency, rate: frequency,...]
data = data || {};
var rates = [];
var totalRates = [];
- 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 generateCells
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
generateCells: function (rowType, outputRow) {
var loans = this.props.loans;
var cells = [];
for (var i=0; i< loans.length; 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 generateClassName
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
generateClassName: function (rowType, outputRow) {
// shows 'linked' or 'independent' state of row's prop in UI
var className = rowType + ' ' + this.props.prop + '-row';
// adds extra top padding to labels on rows with inputs
- 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 DataDocument
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function DataDocument( inputs ) {
var _inputs = inputs;
/**
* @returns {Array} Array of recorded inputs.
- 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"