Restuta/rcn.io

View on GitHub

Showing 82 of 1,769 total issues

File 2016-ncnca-events.js has 13026 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*eslint-disable */

export default [
  {
  "id": "evt-2016-jan-03-23546-cx",
Severity: Major
Found in src/client/temp/data/2016-ncnca-events.js - About 1 mo to fix

File 2017-ncnca-events.js has 3987 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*eslint-disable */

export default [
  {
    "id" : "evt-ncnca-2017-san-bruno-hill-climb-rkJyeFqXl",
Severity: Major
Found in src/client/temp/data/2017-ncnca-events.js - About 1 wk to fix

File 2016-mtb-manual.js has 1095 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*eslint-disable */

//events that we manually crated based on our research of available MTB resources, but that were originally missing
//in MTB calendar
export default [
Severity: Major
Found in src/client/temp/data/2016-mtb-manual.js - About 2 days to fix

File 2016-mtb.js has 924 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*eslint-disable */
export default [
  {
    "id": "evt-90cfc18bcc179b9f86bed6c88ab025ad",
    "discipline": "MTB",
Severity: Major
Found in src/client/temp/data/2016-mtb.js - About 2 days to fix

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

  render() {
    const sizeToPx = size => (Typography.BASE_FONT_SIZE_PX * Typography.scaleUp(size)) + 'px'
    const getFontSize = size => Typography.scaleUp(size) + 'rem'
    const eventName = `John C. Schlesinger Memorial Circuit Race and Team Time Trial AND SOME UPPER CASE
    John C. Schlesinger Memorial Circuit Race and Team Time Trial
Severity: Major
Found in src/client/Dev.js - About 2 days to fix

File example_spec.js has 835 lines of code (exceeds 250 allowed). Consider refactoring.
Open

//
// **** Kitchen Sink Tests ****
//
// This app was developed to demonstrate
// how to write tests in Cypress utilizing
Severity: Major
Found in cypress/integration/example_spec.js - About 2 days to fix

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

  render() {
    const insideModal = renderedInsideModal(this.props)
    //TODO: hardcoding timezone for now, it should come from calendar later
    const moment = () => momentTZ.tz(...arguments, 'America/Los_Angeles')
    const today = moment()
Severity: Major
Found in src/client/calendar/events/event-details/EventDetails.jsx - About 1 day to fix

File Dev.js has 454 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable max-len */
import React from 'react'
import Component from 'react-pure-render/component'
import Row from 'atoms/Row.jsx'
import Col from 'atoms/Col.jsx'
Severity: Minor
Found in src/client/Dev.js - About 6 hrs to fix

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

  render() {
    const {
      widthColumns,
      containerWidth,
      autoHeight = false,
Severity: Major
Found in src/client/calendar/events/Event.jsx - About 6 hrs to fix

Function render has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    const {
      widthColumns,
      containerWidth,
      autoHeight = false,
Severity: Minor
Found in src/client/calendar/events/Event.jsx - About 5 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 117 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const {
      year,
      prefix,
      name,
Severity: Major
Found in src/client/admin/events/CreateEventId.jsx - About 4 hrs to fix

Function getEventColor has 114 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

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

Function getConfig has 111 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const getConfig = (env) => {
  // define all vendor depnencies with pathes relative to node_modules/
  // that are pre-compiled, this allows to configure webpack to skip parsing of them
  // and we can use them for prod build instead of minifying libs ourself we would use pre-combiled ones
  const preBuiltVendorDeps = {
Severity: Major
Found in webpack/common-config.js - About 4 hrs to fix

Function render has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    const insideModal = renderedInsideModal(this.props)
    //TODO: hardcoding timezone for now, it should come from calendar later
    const moment = () => momentTZ.tz(...arguments, 'America/Los_Angeles')
    const today = moment()
Severity: Minor
Found in src/client/calendar/events/event-details/EventDetails.jsx - About 3 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 78 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const { fileName } = this.props
    const { hasError, errorMsg, uploadedFiles } = this.state

    const uploaderStyle = {
Severity: Major
Found in src/client/admin/events/FlyerUploader.jsx - About 3 hrs to fix

File EventDetails.jsx has 296 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, {PropTypes} from 'react'
import Component from 'react-pure-render/component'
import './EventDetails.scss'
import Row from 'atoms/Row.jsx'
import Col from 'atoms/Col.jsx'
Severity: Minor
Found in src/client/calendar/events/event-details/EventDetails.jsx - About 3 hrs to fix

File reducer.js has 295 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { combineReducers } from 'redux'
import { handleActions as makeReducer } from 'redux-actions'
import { routerReducer } from 'react-router-redux'
import {
  norcalMtb2016Events,
Severity: Minor
Found in src/shared/reducers/reducer.js - About 3 hrs to fix

Function getLoaders has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const getLoaders = (env) => {
    let loaders = []

    if (env === 'prod') {
      loaders = loaders.concat([{
Severity: Major
Found in webpack/common-config.js - About 2 hrs to fix

File Event.jsx has 282 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, {PropTypes} from 'react'
import Component from 'react-pure-render/component'
import Location from './Location.jsx'
import Typography from 'styles/typography'
import Colors from 'styles/colors'
Severity: Minor
Found in src/client/calendar/events/Event.jsx - About 2 hrs to fix
Severity
Category
Status
Source
Language