Showing 48 of 242 total issues
Function render
has 215 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { mapShown } = this.state
const { region, states } = this.props
const toggles = [
{ disabled: !mapShown, type: 'table' },
Function render
has 176 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
colors,
crime,
mutedColors,
File About.js
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react'
import Helmet from 'react-helmet'
import { Link } from 'react-router'
import { connect } from 'react-redux'
import reduceEntries from 'reduce-entries'
Function render
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
/* eslint-disable */
const {
coordinates,
place,
Function render
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
crime,
colors,
places,
Function render
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
colors,
id,
keys,
Function render
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
data,
id,
noun,
Function fetchData
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
Open
const fetchData = () => (dispatch, getState) => {
const { filters, region, states } = getState()
if (region.loaded && states.loaded) {
filters.placeId = getPlaceId(filters, region.region, states.states)
if (filters.placeType === 'state') {
- 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 render
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Open
render() {
const { data, year, until } = this.props
const id = snakeCase(data.ui_text)
const { isCounts } = this.state
- 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 render
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { actions, agencies, filters, params, region, states } = this.props
const { pageType } = params
const { place, placeType } = getPlaceInfo(params)
Function render
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { data, margin, noun, size, title, xLabel } = this.props
const { hover } = this.state
const id = slugify(`histogram-${title}`)
Function render
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { files, sampleFile, title, fileType, link } = this.props
let data
if (sampleFile === '/files/pe_employee_data_small.json') {
data = peCsv
Function render
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { location } = this.props
const { isOpen } = this.state
return (
Function render
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { colors, changeColorOnHover, mapClick, place, stateView, states, region } = this.props
const { hover } = this.state
const svgDataWithNames = svgData.map(s => ({
...s,
Function render
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { data } = this.props
const { search, hasSelection, showResults } = this.state
// get unique set of counties (for result grouping)
File NibrsContainer.js
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import startCase from 'lodash.startcase'
import PropTypes from 'prop-types'
import React from 'react'
import { connect } from 'react-redux'
Function calculateRates
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const calculateRates = (summaries, placeType) => {
const nonOffenseKeys = ['caveats', 'population', 'state_abbr', 'year']
let places
if (placeType !== 'region') {
places = Object.keys(summaries).map(place => {
Function render
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { colors, keys, data, size, title } = this.props
const { hover } = this.state
const { height, width } = size
Function render
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { title } = this.props
const details = downloadDetails.find(e => e.title === title)
if (!details) return <div>TBD</div>
return (
Function render
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const isBtnDisabled = !(this.state.place && this.state.year)
const nibrsYears = this.getYearRange(this.state.place)
return (