Showing 82 of 1,769 total issues
Function createEvent
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createEvent = rawEvent => {
const name = rawEvent.name.replace(/--/g, '—')
const date = moment(rawEvent.date, 'MMMM DD YYYY')
const datePlain = date.format('MMDDYYYY')
- Create a ticketCreate a ticket
Function transformEvents
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
.map(event => {
if (!event['Race Name'] || !event['Race Name'].trim()) {
return null
}
- Create a ticketCreate a ticket
Function EventName
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EventName = (props) => {
const {
name,
size,
height,
- Create a ticketCreate a ticket
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const listStyle = { color: Colors.deepPurple200, }
const inactiveStyle = { color: Colors.deepPurple300, }
const activeStyle = {
color: Colors.deepPurple600,
- Create a ticketCreate a ticket
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div className="Home">
<h2 className="header-regular w-300 text-5 header-rcn">RCN.IO</h2>
<section className="section-main">
- Create a ticketCreate a ticket
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
name,
color = '',
size,
- Create a ticketCreate a ticket
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { permitNumber } = this.state
const fileName = (permitNumber === DEFAULT_PERMIT_NAME) ? '' : `flyer-${permitNumber}.pdf`
- Create a ticketCreate a ticket
Function parseRoadType
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const parseRoadType = lowerCaseName => {
const nameContains = partialRight(contains, [lowerCaseName])
if (nameContains('road race')) {
return EventTypes.road.roadRace
- Read upRead up
- Create a ticketCreate a ticket
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 parseCollegiate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const parseCollegiate = lowerCaseName => {
const nameContains = partialRight(contains, [lowerCaseName])
if (nameContains('road race')) {
return EventTypes.collegiate.roadRace
- Read upRead up
- Create a ticketCreate a ticket
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 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
//skip first render to get required dom property
if (!this.state || !this.state.viewportHeight) {
return null
}
- Create a ticketCreate a ticket
Function parseLocation
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const parseLocation = rawLocation => {
const detailedLocation = rawLocation.detailed
let streetAddress = ''
let city = ''
- Create a ticketCreate a ticket
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { event } = this.props
return (
<div className="EventPreview">
- Create a ticketCreate a ticket
Function updateRegLinks
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const updateRegLinks = previousEvents => justConvertedEvents => {
const previousEventsByPermit = groupBy('usacPermit', previousEvents)
const getRegistrationUrl = (usacStatus, newRegUrl, prevRegUrl) => {
if (usacStatus === 'Complete' && newRegUrl === '') {
return prevRegUrl
- Read upRead up
- Create a ticketCreate a ticket
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 getBaseHeight
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const getBaseHeight = containerWidth => {
//for small containers there is no constant size we can compare to
if (containerWidth < Grid.ContainerWidth.SM) {
return 2
}
- Read upRead up
- Create a ticketCreate a ticket
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
Avoid deeply nested control flow statements. Open
if (source.hasOwnProperty(nextKey)) {
output[nextKey] = source[nextKey];
}
- Create a ticketCreate a ticket
Function getContainerWidth
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getContainerWidth(browserWidth) {
//should match variables from bootstrap
if (browserWidth <= ContainerWidth.SM) {
- Read upRead up
- Create a ticketCreate a ticket
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 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { location = {city: '', state: ''}, size, showState = false } = this.props
const { city, state } = location
let addressToShow = showState ? `${city}, ${state}` : city
- Read upRead up
- Create a ticketCreate a ticket
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 getUpcomingEvents
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const getUpcomingEvents = (upcomingEvents, noOfUpcomingDays) => {
let upcomingEventsForCurrentDay = []
let currDate
let upcomingEventsArr = []
- Read upRead up
- Create a ticketCreate a ticket
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 @@router/LOCATION_CHANGE
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
['@@router/LOCATION_CHANGE']: (state, action) => {
const locationState = action.payload.state
// splitting on sub-actions
if (locationState && locationState.subActionName) {
- Read upRead up
- Create a ticketCreate a ticket
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 formatValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const formatValue = value => {
const dateFormat = 'MMMM DD YYYY'
if (isString(value)) {
const date = moment(value, dateFormat)
- Read upRead up
- Create a ticketCreate a ticket
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"