Showing 67 of 188 total issues
File committee-single.js
has 609 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/* global document, context */
var $ = require('jquery');
File constants.py
has 604 lines of code (exceeds 250 allowed). Consider refactoring. Open
from collections import OrderedDict
START_YEAR = 1979
END_YEAR = 2018
DEFAULT_TIME_PERIOD = 2018
File columns.js
has 602 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var _ = require('underscore');
var columnHelpers = require('./column-helpers');
File tables.js
has 569 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var $ = require('jquery');
var _ = require('underscore');
File elections.js
has 500 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/* global document, context */
var d3 = require('d3');
File routes.py
has 456 lines of code (exceeds 250 allowed). Consider refactoring. Open
import http
import datetime
import re
File candidate-single.js
has 430 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/* global require, document, context, WEBMANAGER_EMAIL */
var $ = require('jquery');
Function Tags
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
function Tags(props) {
const namedFields = [];
Array.prototype.push.apply(namedFields, requestorOptions);
Array.prototype.push.apply(namedFields, documentTypes);
namedFields.push({value: 'ao_is_pending', text: "Pending"});
- 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 initContributionsTables
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initContributionsTables() {
var $allTransactions = $('table[data-type="individual-contributions"]');
var $contributionSize = $('table[data-type="contribution-size"]');
var $contributorState = $('table[data-type="contributor-state"]');
var displayCycle = helpers.formatCycleRange($allTransactions.data('cycle'), 2);
Function load_legal_mur
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def load_legal_mur(mur_no):
url = '/legal/docs/murs/'
mur = _call_api(url, parse.quote(mur_no))
- 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 filterSuccessUpdates
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
function filterSuccessUpdates(changeCount) {
// on filter change update:
// - loading/success status
// - count change message
- 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 Tags
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Tags(props) {
const namedFields = [];
Array.prototype.push.apply(namedFields, requestorOptions);
Array.prototype.push.apply(namedFields, documentTypes);
namedFields.push({value: 'ao_is_pending', text: "Pending"});
Function filterSuccessUpdates
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function filterSuccessUpdates(changeCount) {
// on filter change update:
// - loading/success status
// - count change message
Function SearchResults
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
function SearchResults(props) {
function highlights(advisory_opinion) {
return {__html: '…' + advisory_opinion.highlights }
}
File line-chart.js
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/* global module, DEFAULT_TIME_PERIOD */
var $ = require('jquery');
var _ = require('underscore');
File helpers.js
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/* global Intl, BASE_PATH, API_LOCATION, API_VERSION, API_KEY */
var URI = require('urijs');
Function render_committee
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def render_committee(committee, candidates, cycle, redirect_to_previous):
# committee fields will be top-level in the template
tmpl_vars = committee
tmpl_vars['parent'] = 'data'
- 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 election-search.js
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/* global window */
var $ = require('jquery');
File views.py
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
import datetime
import furl
from flask.views import MethodView
Function stateMap
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function stateMap($elm, data, width, height, min, max, addLegend, addTooltips) {
var svg = d3.select($elm[0])
.append('svg')
.attr('width', width)
.attr('height', height);