Showing 25 of 104 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 + "']")
},
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
`` has 27 functions (exceeds 20 allowed). Consider refactoring. Open
export default {
// The realtime block is just `data.totals.active_visitors` formatted with commas
realtime: renderBlock.loadAndRender().render((selection, data) => {
const totals = data.data[0];
selection.text(formatters.addCommas(+totals.active_visitors));
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 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 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
Method initialize
has 14 arguments (exceeds 4 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)
Function pagination
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
pagination: function () {
var previousButtons = document.getElementsByClassName("previous-section");
var nextButtons = document.getElementsByClassName("next-section");
var self = this;
Function formSuccess
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
formSuccess: function (e) {
// Clear the alert box
var formComponent = this.formComponent();
var alertElement = formComponent.querySelector(".fba-alert");
var alertElementBody = formComponent.getElementsByClassName("usa-alert__text")[0];
Method generate
has 37 lines of code (exceeds 25 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
Function secondsToReadableTime
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function secondsToReadableTime(paramSeconds) {
const secondsInAYear = 31536000;
const secondsInADay = 86400;
const secondsInAnHour = 3600;
const secondsInAMinute = 60;