Showing 25 of 42 total issues
File policy.js
has 960 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
/* eslint-disable react/no-unescaped-entities, max-len */
import * as React from 'react';
File policy.js
has 559 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import * as React from 'react';
import styles from '../../components/policy/style.css';
import { P, H3, SerifH3, B, PolicyList } from '../../components/policy/shared';
File index.js
has 499 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
// Components
import ScrollTracker from '../../../../components/scroll-tracker';
import Social from '../../../../components/social';
File definitions.js
has 466 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import { stateToBadgerProps, genBadgersParams, getBadgersTitle } from './selectors';
type RouteDefinition = {|
title: string | ((props: Object) => string),
File index.js
has 378 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import React from 'react';
import Social from '../../../../components/social';
import Image from '../../../../components/image';
File index.js
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import React from 'react';
import Social from '../../../../components/social';
import Image from '../../../../components/image';
File index.js
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import React from 'react';
import classnames from 'classnames/bind';
import Social from '../../../../components/social';
import Image from '../../../../components/image';
File index.js
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
// Components
import ScrollTracker from '../../../../components/scroll-tracker';
import Social from '../../../../components/social';
File index.js
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
import marked from 'marked';
import fetch from 'node-fetch';
import handleErrors from '../util/handle-errors';
const badgerBrainEndpoint = () => process.env.BADGER_BRAIN_HOST;
File index.js
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
const MapDotImage = () => (
<svg viewBox="0 0 927 527" xmlns="http://www.w3.org/2000/svg">
<defs />
File index.js
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
const MapDotImage = () => (
<svg viewBox="0 0 927 527" xmlns="http://www.w3.org/2000/svg">
<defs />
File index.js
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import React from 'react';
import classnames from 'classnames/bind';
File policy.js
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
/* eslint-disable react/no-unescaped-entities */
import * as React from 'react';
File index.js
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import React from 'react';
import Cookies from 'js-cookie';
import FormField from './formField';
Function isValidTweet
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const isValidTweet = (tweet: TwitterResponse) => {
try {
if (!tweet) {
throw new Error('Missing tweet');
}
- 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 getSiteRoutes
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export default function getSiteRoutes(state, routeDefinitions) {
const allRoutes = [];
// eslint-disable-next-line no-restricted-syntax
for (const definition of routeDefinitions) {
- 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 splitEvents
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function splitEvents({
events, // array of events
timeline, // one of 'past', 'today', 'future'
reverse = false, // optionally reverse final list of events
todayDateTime = new Date(), // iso string representing today date
- 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 scrollTo
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const scrollTo = params => () => {
if (params.contactUs) {
let el = document.getElementById('contactUs');
if (el && el.scrollIntoView) {
- 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 setWindowSize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
static setWindowSize() {
let currentWidth = 'tablet';
if (typeof window !== 'undefined') {
if (window.innerWidth < screenBreakPoints.tablet) {
currentWidth = 'mobile';
- 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 setWindowSize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
static setWindowSize() {
let currentWidth = 'tablet';
if (typeof window !== 'undefined') {
if (window.innerWidth < screenBreakPoints.tablet) {
currentWidth = 'mobile';
- 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"