Restuta/rcn.io

View on GitHub

Showing 82 of 1,769 total issues

Function render has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    // console.info('Day render')
    const {
      size,
      day,
Severity: Major
Found in src/client/calendar/Day.jsx - About 2 hrs to fix

Function render has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const {
       width,
       height,
       homeAddress,
Severity: Major
Found in src/client/calendar/events/event-details/GoogleStaticMap.jsx - About 2 hrs to fix

Function getEventColor has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

const getEventColor = (discipline, type, status = '') => {
  let eventColor = ''
  switch (status) {
    case 'Canceled':
      eventColor = Colors.event.status.canceled
Severity: Minor
Found in src/client/calendar/utils/event-colors.js - About 2 hrs to fix

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 16 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    // console.info('Day render')
    const {
      size,
      day,
Severity: Minor
Found in src/client/calendar/Day.jsx - About 2 hrs to fix

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 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  ['@@router/LOCATION_CHANGE']: (state, action) => {
    const locationState = action.payload.state

    // splitting on sub-actions
    if (locationState && locationState.subActionName) {
Severity: Minor
Found in src/shared/reducers/reducer.js - About 2 hrs to fix

Function shallowEqual has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

function shallowEqual(objA, objB, except = {exceptProps: []}, compName = '<unknown>') {
  if (is(objA, objB)) {
    return true
  }

Severity: Minor
Found in src/client/utils/shallow-equal-except.js - About 1 hr to fix

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 14 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    // Perf.start()
    this.whenRenderStarted = +new Date()
    console.info('Calendar render is called') //eslint-disable-line
    const {
Severity: Minor
Found in src/client/calendar/Calendar.jsx - About 1 hr to fix

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 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const {
      url,
      showHeader = true,
      showBorder = false,
Severity: Minor
Found in src/client/calendar/events/event-details/Flyer.jsx - About 1 hr to fix

Function render has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const {
      type = 'secondary',
      size = 'md',
      primaryHover,
Severity: Minor
Found in src/client/atoms/Button.jsx - About 1 hr to fix

Function render has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const {containerWidth} = this.props

    const style = {
      position: 'fixed',
Severity: Minor
Found in src/client/temp/debug/DebugGrid.jsx - About 1 hr to fix

Function S3Router has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function S3Router(options) {
  const S3_BUCKET = options.bucket + (options.directory || '')
  // only for returning to the client
  const directory = options.directory || ''

Severity: Minor
Found in src/server/routers/s3-router.js - About 1 hr to fix

Function GridLines has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const GridLines = (props) => {
  const thiknessPx = 4

  const baseStyle = {
    position: 'fixed',
Severity: Minor
Found in src/client/temp/debug/DebugGrid.jsx - About 1 hr to fix

Function render has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {

    const { useStaticLinks = false } = this.props

    const Link = getLinkComponent(useStaticLinks)
Severity: Minor
Found in src/client/navs/TopNavbar.jsx - About 1 hr to fix

Function parsePromoter has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const parsePromoter = promoterRaw => {
  const clubId = getClubIdFromUrl(promoterRaw.url)

  let matchingPromoter = promotersByClubId[clubId]

Severity: Minor
Found in src/server/events/usac/events-converter/parsers/promoter.js - About 1 hr to fix

Function render has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const { containerWidth, calendarIsLoading } = this.props
    const calendarId = getDraftCalendarId(this.props.params.calendarId)
    let weekdaysSizes

Severity: Minor
Found in src/client/calendar/NcncaDraftCalendar.js - About 1 hr to fix

Function render has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const {sizes} = this.props

    const rowStyle = {
      flexWrap: 'nowrap'
Severity: Minor
Found in src/client/calendar/WeekdaysHeader.jsx - About 1 hr to fix

Function render has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const { copied } = this.state
    const {
      type = 'button',
      whatToCopyText = '',
Severity: Minor
Found in src/client/atoms/CopyToClipboardButton.jsx - About 1 hr to fix

Function convertUsacEventToRcnEvent has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

const convertUsacEventToRcnEvent = previousEventsByPermit => rawUsacEvent => {
  const existingRcnEvents = previousEventsByPermit[trim(rawUsacEvent.permit)]

  const existingRcnEvent = existingRcnEvents
    ? (existingRcnEvents.length === 1)
Severity: Minor
Found in src/server/events/usac/events-converter/index.js - About 1 hr to fix

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 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {

    const { calendar, events } = this.props
    const NO_OF_UPCOMING_DAYS = 4

Severity: Minor
Found in src/client/widgets/events/UpcomingEvents.jsx - About 1 hr to fix

Function render has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    let {
      square,
      inverted,
      color = Colors.bodyBg,
Severity: Minor
Found in src/client/calendar/badges/Badge.jsx - About 1 hr to fix
Severity
Category
Status
Source
Language