Showing 90 of 154 total issues
Function EventObserver
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function EventObserver() {
// The events registered on this instance.
var _events = {};
- 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 EventObserver
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function EventObserver() {
// The events registered on this instance.
var _events = {};
Function flags
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
flags: function() {
return [
{
text: 'There is a chance I might move within the next few years',
grade: null,
Function render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function () {
return (
<div className="next-steps-container">
<div className="content-l content-l__main">
<div className="content-l_col content-l_col-1">
Function getRateData
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getRateData() {
if ( currentRequest && typeof currentRequest === 'object' ) {
currentRequest.abort();
}
Function renderInterestAmounts
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderInterestAmounts() {
var shortTermVal = [],
longTermVal = [],
rate,
fullTerm = +( getSelection( 'loan-term' ) ) * 12;
Function InputGraded
has a Cognitive Complexity of 11 (exceeds 5 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.
- 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 11 (exceeds 5 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) {
- 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 componentDidMount
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentDidMount: function() {
var scenario = this.state.scenario;
var animating;
LoanStore.addChangeListener(this._onChange);
Function dispatchToken
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
LoanStore.dispatchToken = AppDispatcher.register( function( action ) {
switch( action.actionType ) {
case LoanConstants.UPDATE_LOAN:
// update both loans or single loan, dep. on whether the prop changed
Function Observer
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Observer = (function(){
var wraped = [];
var Observer = function(O, callback, accept){
validateArguments(O, callback, accept);
if (!accept) {
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
var loading = "";
var results = ['closing-costs','monthly-payment','overall-costs'].map(function (prop) {
return (
<LoanOutputTable result={prop} prop={prop} loans={this.props.loans} scenario={this.props.scenario} />
Function checkARM
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function checkARM() {
// reset warning and info
$( '#arm-warning' ).addClass( 'hidden' );
$( '.arm-info' ).addClass( 'hidden' );
var disallowedTypes = [ 'fha', 'va', 'va-hb', 'fha-hb' ];
Function EmailSignup
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function EmailSignup( element ) {
var UNDEFINED;
var _baseElement = $(element);
var _formElement = _baseElement.find( 'form' );
var _emailElement = _formElement.find( 'input[type="email"]' );
- 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 dispatchToken
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
LoanStore.dispatchToken = AppDispatcher.register( function( action ) {
switch( action.actionType ) {
case LoanConstants.UPDATE_LOAN:
// update both loans or single loan, dep. on whether the prop changed
- 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 filterEmptyRows
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
this.filterEmptyRows = function( worksheet, opts ) {
// Filters out worksheet rows without text values
// opts.requireGrade = true will also filter out items without grades
// opts.skipLast = true will allow blank values for last item
// TODO: add delete option?
- 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 InputNotes
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function InputNotes( options ) {
// TODO see if bind() can be used in place of _self = this.
// Note bind()'s lack of IE8 support.
var _self = this;
var _row = options.row;
Function loadPage
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadPage( lastPage, pageNum ) {
formExplainer.currentPage = pageNum;
$( '.form-explainer_page-link' ).removeClass( 'current-page' );
$( '.form-explainer_page-link[data-page=' + pageNum + ']' ).addClass( 'current-page' );
Function risks
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
risks: function() {
return [
{
text: 'My home value could decline and I could lose my equity',
grade: null,
Function personal
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
personal: function() {
return [
{
text: 'I want more space (e.g., for a growing family).',
grade: null,