Showing 16 of 240 total issues
File tract-hoods.py
has 1067 lines of code (exceeds 250 allowed). Consider refactoring. Open
from osgeo import ogr
from csv import reader, DictReader
import json
neighborhoods_ds = ogr.Open('2768/neighborhoods.shp')
File lib.js
has 451 lines of code (exceeds 250 allowed). Consider refactoring. Open
var RESPONSES = 'Survey responses',
GREENS = 'Greens_05', BLUES = 'Blues_05', ORANGES = 'YlOrBr_05',
GEO_COLUMN = 'Geographic Area',
CR_API_BASE = 'http://api.censusreporter.org/1.0',
CR_API_PAGE = 60;
Function surveyResults
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
ResidentResearch.surveyResults = function() {
var spreadsheet_url= null,
responses= null, tracts= null,
city= {name: null, geoid: null},
maps= {
Function map
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
ResidentResearch.map = function() {
var elementId = "",
popupOpened = false,
geojson = {},
style = {},
Function censusReporter
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
ResidentResearch.censusReporter = function(tracts) {
tracts = tracts;
resultData = [];
var appendData = function(tract) {
Function surveyResults
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
ResidentResearch.surveyResults = function() {
var spreadsheet_url= null,
responses= null, tracts= null,
city= {name: null, geoid: null},
maps= {
- 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 map
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
ResidentResearch.map = function() {
var elementId = "",
popupOpened = false,
geojson = {},
style = {},
- 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 load_spreadsheet
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function load_spreadsheet(gdoc_url, sheet_name, onsuccess, onerror)
{
Tabletop.init({
key: gdoc_url, callback: callback,
simpleSheet: true, wanted: [sheet_name]
- 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 get_style_function
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_style_function(tracts, data_point, colors)
{
var value, data = {},
histogram = [], minimum, maximum,
color_list = get_color_list(colors);
Function correlation
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
ResidentResearch.correlation = function() {
with_no_population = function(object_to_filter) {
return object_to_filter.population !== false;
}
Function load_spreadsheet
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function load_spreadsheet(gdoc_url, sheet_name, onsuccess, onerror)
{
Tabletop.init({
key: gdoc_url, callback: callback,
simpleSheet: true, wanted: [sheet_name]
Function loaded_spreadsheet
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
var loaded_spreadsheet = function(all_responses, spreadsheet_url) {
responses = all_responses;
spreadsheet_url = spreadsheet_url;
var geo_responses = [],
languages = {
Function calculate_regression
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function calculate_regression(tracts, numerator, denominator)
{
var points = [],
total = 0;
Function callback
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function callback(data, ttop)
{
var responses = [];
try {
Function timedChunk
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function timedChunk(items, process, context, callback, chunkCallback){
Function calculate_regression
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function calculate_regression(tracts, numerator, denominator)
{
var points = [],
total = 0;
- 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"