Showing 35 of 190 total issues
Function FBAform
has 535 lines of code (exceeds 25 allowed). Consider refactoring. Open
function FBAform(d, N) {
return {
formId: "15ca967f",
formComponent: function () {
return document.querySelector("[data-touchpoints-form-id='" + this.formId + "']")
Function FBAform
has a Cognitive Complexity of 129 (exceeds 5 allowed). Consider refactoring. Open
function FBAform(d, N) {
return {
formId: "15ca967f",
formComponent: function () {
return document.querySelector("[data-touchpoints-form-id='" + this.formId + "']")
- 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 touchpoints.js
has 544 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
This JS is included directly from the touchpoints app. Included here to
avoid writing unsafe content security policy allowances just for touchpoints.
Minor changes were made to the original source to avoid inline styles.
Method initialize
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
def initialize(site, base, index_files, dir, dir_expr, page_data_prefix, data, name, name_expr, title, title_expr, template, extension, debug)
@site = site
@base = base
if debug
- 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 buildtimeSeries
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function buildtimeSeries() {
let series = function (d) {
return [d];
};
let bars = function (d) {
`` has 37 functions (exceeds 20 allowed). Consider refactoring. Open
return {
formId: "15ca967f",
formComponent: function () {
return document.querySelector("[data-touchpoints-form-id='" + this.formId + "']")
},
File DataDownloads.js
has 368 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from "react";
import PropTypes from "prop-types";
/**
* Creates tables with download links for many of the reports that are available
File HistoricalDataDownload.js
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState } from "react";
import PropTypes from "prop-types";
import { isFuture, parse } from "date-fns";
import { mkConfig, generateCsv } from "export-to-csv";
import DapApiService from "../../lib/dap_api_service";
Method generate
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def generate(site)
# page_gen-dirs is a global option which determines whether we want to
# generate index pages (name/index.html) or HTML files (name.html) for
# all sets
index_files = site.config['page_gen-dirs'] == true
- 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 dap_api_service.spec.js
has 331 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { lightFormat, startOfToday } from "date-fns";
import DapApiService from "../dap_api_service";
import ApiDataItemFactory from "../../../spec/factories/api_data_item";
describe("DapApiService", () => {
Method initialize
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(site, base, index_files, dir, dir_expr, page_data_prefix, data, name, name_expr, title, title_expr, template, extension, debug)
@site = site
@base = base
if debug
Function initRealtimeCountriesChart
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
const initRealtimeCountriesChart = async () => {
// Create countries chart
await d3
.select(countriesRef.current)
.datum({
Function loadAndRender
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadAndRender() {
let url = function (d) {
return d && d.source;
};
Function barChart
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function barChart() {
let bars = function (d) {
return d;
};
Function buildtimeSeries
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export default function buildtimeSeries() {
let series = function (d) {
return [d];
};
let bars = function (d) {
- 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 loadAndRender
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function loadAndRender() {
let url = function (d) {
return d && d.source;
};
- 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 timeSeries
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
const timeSeries = function (svg) {
const right = width - margin.right;
const bottom = height - margin.bottom;
yScale.range([bottom, margin.top]);
Function HistoricalDataDownloads
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function HistoricalDataDownloads({ apiURL, mainAgencyName, agencies }) {
const parsedAgencies = JSON.parse(agencies).map(({ name, slug }) => {
return { name, value: slug };
});
const apiReports = [
- 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 barChart
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export default function barChart() {
let bars = function (d) {
return d;
};
- 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 initTopDownloads
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
const initTopDownloads = async () => {
const result = await d3
.select(ref.current)
.datum({
source: reportURL,