just-paja/improtresk-web

View on GitHub

Showing 46 of 176 total issues

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

  render () {
    const {
      assigned,
      capacity,
      disabled,
Severity: Major
Found in src/orders/components/WorkshopPickerItem.jsx - About 2 hrs to fix

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

      render () {
        const {
          closed,
          description,
          disabled,
    Severity: Major
    Found in src/polls/components/PollAnswer.jsx - About 2 hrs to fix

      File index.js has 254 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import moment from 'moment-timezone'
      
      import { createSelector } from 'reselect'
      import { isRequired, getProgress, transformData } from 'react-saga-rest'
      import { getFormValues } from 'redux-form'
      Severity: Minor
      Found in src/orders/selectors/index.js - About 2 hrs to fix

        Function getPreferredLanguages has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

          (server) => {
            let languages = server.acceptsLanguages || []
            let pathLang = server.pathLang || null
        
            if (typeof window !== 'undefined' && window) {
        Severity: Minor
        Found in src/selectors/locales.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 renderMarkupAndWait has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const renderMarkupAndWait = (req, store, componentTree) => {
          logger.debug(`render: sagas: started for ${req.url}`)
          const rootTask = store.sagaMiddleware.run(serverSagas)
          let resolved = false
          let resolveRender
        Severity: Minor
        Found in src/server/middleware/renderReact.jsx - About 1 hr to fix

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

            render () {
              const {
                activeRequests,
                currentYear,
                entryPath,
          Severity: Minor
          Found in src/components/App.jsx - About 1 hr to fix

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

              render () {
                if (!this.state.showRegistration) {
                  return (
                    <Card>
                      <CardBody>
            Severity: Minor
            Found in src/components/UserEntry.jsx - About 1 hr to fix

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

                render () {
                  const {
                    defaultLabel,
                    error,
                    help,
              Severity: Minor
              Found in src/forms/components/InputRadioGroup.jsx - About 1 hr to fix

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

                  render () {
                    const {
                      foodPickCloseDate,
                      input,
                      meals,
                Severity: Minor
                Found in src/orders/components/MealPicker.jsx - About 1 hr to fix

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

                    render () {
                      const { translate } = this.props
                      const title = translate('pages.contact')
                  
                      return (
                  Severity: Minor
                  Found in src/pages/components/Contact.jsx - About 1 hr to fix

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

                      render () {
                        const {
                          id,
                          date,
                          disabled,
                    Severity: Minor
                    Found in src/orders/components/FoodPickerItem.jsx - About 1 hr to fix

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

                        render () {
                          const { input, meta } = this.props
                          const dates = this.getDates()
                          return (
                            <div>
                      Severity: Minor
                      Found in src/orders/components/StayLengthPicker.jsx - About 1 hr to fix

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

                          render () {
                            const {
                              answers,
                              closed,
                              loading,
                        Severity: Minor
                        Found in src/polls/components/PollQuestion.jsx - About 1 hr to fix

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

                            render () {
                              const {
                                errors,
                                loading,
                                meals,
                          Severity: Minor
                          Found in src/participants/components/ChangeFood.jsx - About 1 hr to fix

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

                              render () {
                                const {
                                  errors,
                                  loading,
                                  submitErrors,
                            Severity: Minor
                            Found in src/participants/components/ChangeWorkshop.jsx - About 1 hr to fix

                              Function server has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export default function server (userConfig = {}) {
                                const app = express()
                                const config = configure(userConfig)
                              
                                logger.level = config.logLevel
                              Severity: Minor
                              Found in src/server/index.js - About 1 hr to fix

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

                                  render () {
                                    const {
                                      signupsClosed,
                                      onSignupsOpen,
                                      signupsOpen,
                                Severity: Minor
                                Found in src/pages/components/Signup.jsx - About 1 hr to fix

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

                                    render () {
                                      const {
                                        changeWorkshop,
                                        order,
                                        onChangeWorkshopChange,
                                  Severity: Minor
                                  Found in src/pages/components/ChangeWorkshop.jsx - About 1 hr to fix

                                    Function RegistrationStatus has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    const RegistrationStatus = ({
                                      activeOrder,
                                      onCancel,
                                      onConfirm,
                                      registrationsCloseDate
                                    Severity: Minor
                                    Found in src/orders/components/RegistrationStatus.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 getPriceLevels has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      year => (year && year.priceLevels ? year.priceLevels
                                        .slice()
                                        .sort((a, b) => {
                                          if (a.takesEffectOn > b.takesEffectOn) {
                                            return -1
                                    Severity: Minor
                                    Found in src/years/selectors/yearPrices.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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language