Showing 90 of 154 total issues
File common.js
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var common = {};
common.loanCount = 2;
Function polyfillElement
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function polyfillElement(elem) {
// If the element is already polyfilled, skip it
if (elem.__placeholder != null) {
// Make sure that if the placeholder is already shown, that it is at least up-to-date
if (elem.__placeholder) {
Function utils
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
var utils = function( id ) {
var $el;
if ( !id ) {
- 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 processCounty
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processCounty() {
var $counties = $( '#county' );
var $county = $( '#county' ).find( ':selected' );
var $loan = dropdown( 'loan-type' );
var norms = [ 'conf', 'fha', 'va' ];
Function Notification
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function Notification( element ) { // eslint-disable-line max-statements, inline-comments, max-len
var BASE_CLASS = 'm-notification';
// Constants for the state of this Notification.
- 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 InputGraded
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
function InputGraded( options ) {
// TODO see if bind() can be used in place of _self = this.
// Note bind()'s lack of IE8 support.
var _self = this;
// Load our handlebar templates.
File worksheet-config.js
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var gradedInput = require( './inputs/input-graded' );
var notesInput = require( './inputs/input-notes' );
var editorTemplate =
Function indexOf
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Array.prototype.indexOf = function(searchElement, fromIndex) {
var k;
// 1. Let O be the result of calling ToObject passing
- 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 processCounty
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function processCounty() {
var $counties = $( '#county' );
var $county = $( '#county' ).find( ':selected' );
var $loan = dropdown( 'loan-type' );
var norms = [ 'conf', 'fha', 'va' ];
- 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 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function () {
var tooltipHtml = common.outputTooltips[this.props.prop]
? <Tooltip text={common.outputTooltips[this.props.prop]}/>
: null;
var headingType = function (prop, type, label, scenario) {
Function checkForJumbo
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function checkForJumbo() {
var loan;
var jumbos = ['jumbo', 'agency', 'fha-hb', 'va-hb'];
var norms = [ 'conf', 'fha', 'va' ];
var warnings = {
Function EmailSignup
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function EmailSignup( element ) {
var UNDEFINED;
var _baseElement = $(element);
var _formElement = _baseElement.find( 'form' );
var _emailElement = _formElement.find( 'input[type="email"]' );
Function positionNotes
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function positionNotes( animating, expandable ) {
var $notes = $( '.educational-note div' );
// Check that we're on desktop
if ( $notes.css( 'position' ) === 'absolute' ) {
Function renderChart
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function renderChart( data, cb ) {
if ( chart.isInitialized ) {
var hc = chart.$el.highcharts();
- 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 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
return (
<div>
<div>
<ScenarioSection scenario={this.state.scenario}/>
Function ButtonGradingGroup
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ButtonGradingGroup( options ) {
// TODO see if bind() can be used in place of _self = this.
// Note bind()'s lack of IE8 support.
var _self = this;
Function jumboCheck
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
jumboCheck: function( loan ) {
var newType;
var loanType = loan['loan-type'];
// make sure we have a previous type
- 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 _checkPropertyListing
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
self._checkPropertyListing = function(dontQueueUpdates){
var object = self._watching, keys = Object.keys(object), i=0, l=keys.length;
var newKeys = [], oldKeys = properties.slice(0), updates = [];
var prop, queueUpdates = !dontQueueUpdates, propType, value, idx, aLength;
Function render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
var className = "lc-inputs", headerText;
// if editing a loan, add classes so the inputs will show on mobile
if (this.props.editing) {
Function _loadSummary
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _loadSummary() {
var pageTemplate = require( '../../templates/prepare-worksheets/page-summary.hbs' );
var summarySection = require( '../../templates/prepare-worksheets/page-summary-section.hbs' );
var summaryError = require( '../../templates/prepare-worksheets/page-summary-error.hbs' );
Handlebars.registerPartial( {