Showing 154 of 154 total issues
Function updateView
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateView() {
chart.startLoading();
// reset view
dropdown( [ 'county', 'loan-term' ] ).hideHighlight();
Function Notification
has 75 lines of code (exceeds 25 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.
Function Worksheet
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Worksheet( options ) {
var _inputsList = {};
var _inputsGroupDOM;
var _container = options.container;
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
Similar blocks of code found in 3 locations. Consider refactoring. Open
}, {
name: 'interest-fees-paid',
source: function() {
return cost( {
amountBorrowed: positive( loan['amount-borrowed'] ),
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 82.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
}, {
name: 'principal-paid',
source: function() {
return cost( {
amountBorrowed: positive( loan['amount-borrowed'] ),
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 82.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
}, {
name: 'overall-cost',
source: function() {
return cost( {
amountBorrowed: positive( loan['amount-borrowed'] ),
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 82.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ( hash !== '' && $expandable.length && !$expandable.hasClass( 'expandable__expanded' ) ) {
$expandable.find( '.expandable_target' )[0].click();
$.scrollTo( $el, {
duration: 600,
offset: -30
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 80.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ( hash !== '' &&
$expandable.length &&
!$expandable.hasClass( 'expandable__expanded' ) ) {
$expandable.find( '.expandable_target' )[0].click();
$.scrollTo( $el, {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 80.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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"]' );