Showing 176 of 242 total issues
Function render
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { places, summaries, region, states, filters } = this.props
const placeName = lookupDisplayName(filters, region.regions, states.states)
const isReady = !summaries.loading
Function render
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { actions, agencies, filters, params, region, states } = this.props
const { pageType } = params
const { place, placeType } = getPlaceInfo(params)
- 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 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { error } = this.state
const { ariaControls, since, until } = this.props
return (
Function render
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { crime } = this.props
const { caveats, links } = content.crimes[crime]
return (
Function render
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { error } = this.state
return (
<div>
Function offenderDemo
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
const offenderDemo = data => {
const {
offenderAgeNum,
offenderEthnicity,
offenderRaceCode,
Function render
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { files, sampleFile, title, fileType, link } = this.props
let data
if (sampleFile === '/files/pe_employee_data_small.json') {
data = peCsv
- 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 XAxis
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const XAxis = ({ active, tickCt, tickSizeOuter, height, scale, showLine }) => {
const range = scale.range()
const [range0, range1, k] = [range[0] + 0.5, range[range.length - 1] + 0.5, 1]
const domain = `M${range0},${k * tickSizeOuter}V0.5H${range1}V${k *
tickSizeOuter}`
- 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 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
agency,
isAgency,
policeEmployment,
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
ariaControls,
className,
onFocus,
Function render
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
render() {
/* eslint-disable */
const {
coordinates,
place,
- 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 victimDemo
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const victimDemo = data => {
const { victimAgeNum, victimEthnicity, victimRaceCode, victimSexCode } = data
return {
title: 'Victim demographics',
Function fetchUcrParticipation
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const fetchUcrParticipation = filters => dispatch => {
dispatch(fetchingUcrParticipation())
const params = { size: 100 }
const { place, placeType, placeId } = filters
Function render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { data, size, yMax } = this.props
const { svgParentWidth } = this.state
const { margin } = size
const width = svgParentWidth || size.width
Function participationCsvLink
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const participationCsvLink = (place, type, states, participation) => {
if (type === 'agency') return []
if (type === 'region') return []
const clickHander = () => {
Function validateFilter
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const validateFilter = filters => {
const newFilters = { ...filters }
if (filters.page === null) {
newFilters.page = defaults.page
newFilters.pageType = defaults.pageType
- 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 ExplorerHeaderContainer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const ExplorerHeaderContainer = ({
agencies,
agency,
coordinates,
isAgency,
- 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 NibrsCard
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const NibrsCard = ({ crime, data, place, placeType, since, title, until }) => {
const charts = data.map((d, i) => {
const props = {
key: i,
id: slugify(d.title || title).replace(/['’]/g, ''),
- 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 filterByYear
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const filterByYear = (summaries, since, until) => {
const places = Object.keys(summaries).map(place => {
const filtered = summaries[place].filter(y => {
const { year } = y
if (since && until && +year >= since && +year <= until) return 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
Function fetchLeoka
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const fetchLeoka = params => dispatch => {
dispatch(fetchingLeoka())
const { placeType, place, placeId } = params
- 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"