just-paja/improtresk-web

View on GitHub

Showing 176 of 176 total issues

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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    const SignupSuccess = () => (
      <Alert color='success'>
        <h4><Message name='generic.success' /></h4>
        <p>
          <Message name='participants.signupSuccess' />
    Severity: Major
    Found in src/participants/components/SignupSuccess.jsx and 1 other location - About 2 hrs to fix
    src/participants/components/ResetPasswordSuccess.jsx on lines 6..13

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 76.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    const ResetPasswordSuccess = () => (
      <Alert color='success'>
        <h4><Message name='generic.success' /></h4>
        <p>
          <Message name='participants.passwordChangeEmailSent' />
    Severity: Major
    Found in src/participants/components/ResetPasswordSuccess.jsx and 1 other location - About 2 hrs to fix
    src/participants/components/SignupSuccess.jsx on lines 6..13

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 76.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    export default ({
      routine,
      identAttr
    }) => ({
      [routine.TRIGGER]: identAttr ? invalidateOnResourceChange(identAttr, 'payload') : undefined,
    Severity: Major
    Found in src/reducers/createCollectionReducers.js and 1 other location - About 2 hrs to fix
    src/reducers/createFetchReducers.js on lines 11..20

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 75.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    export default ({
      routine,
      identAttr
    }) => ({
      [routine.TRIGGER]: identAttr ? invalidateOnResourceChange(identAttr, 'payload') : undefined,
    Severity: Major
    Found in src/reducers/createFetchReducers.js and 1 other location - About 2 hrs to fix
    src/reducers/createCollectionReducers.js on lines 11..20

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 75.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

              {!identOk ? (
                <Alert color='danger'>
                  <IconMessage icon='exclamation-triangle' name='orders.needToFillInIdentification' />
                  {' '}
                  <Link to='participantIdentityEdit'>
        Severity: Major
        Found in src/orders/components/OrderAccomodationStatus.jsx and 1 other location - About 1 hr to fix
        src/orders/components/OrderAccomodationStatus.jsx on lines 49..57

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 71.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

              {order.paid && !roomOk ? (
                <Alert color='danger'>
                  <IconMessage icon='exclamation-triangle' name='orders.needToChooseRoom' />
                  {' '}
                  <Link to='participantRoomSelection'>
        Severity: Major
        Found in src/orders/components/OrderAccomodationStatus.jsx and 1 other location - About 1 hr to fix
        src/orders/components/OrderAccomodationStatus.jsx on lines 40..48

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 71.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          export function * requireTipList () {
            yield takeEvery(
              constants.TIPS_REQUIRED,
              fetchResourceIfRequired,
              api.fetchTips,
          Severity: Major
          Found in src/texts/sagas/fetchTips.js and 1 other location - About 1 hr to fix
          src/participants/sagas/teams.js on lines 9..23

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 70.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          export function * fetchTeamsOnMount () {
            yield takeLatest(
              constants.TEAMS_REQUIRED,
              fetchResourceIfRequired,
              api.fetchTeams,
          Severity: Major
          Found in src/participants/sagas/teams.js and 1 other location - About 1 hr to fix
          src/texts/sagas/fetchTips.js on lines 9..23

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 70.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  {meta.touched && meta.error ? (
                    <FormFeedback>
                      <FormErrors
                        errors={meta.error}
                        data={{ field: input.name }}
          Severity: Major
          Found in src/orders/components/StayLengthPicker.jsx and 1 other location - About 1 hr to fix
          src/orders/components/MealPicker.jsx on lines 58..65

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 68.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  {meta.touched && meta.error ? (
                    <FormFeedback>
                      <FormErrors
                        errors={meta.error}
                        data={{ field: input.name }}
          Severity: Major
          Found in src/orders/components/MealPicker.jsx and 1 other location - About 1 hr to fix
          src/orders/components/StayLengthPicker.jsx on lines 69..76

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 68.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  export const orderChangeFood = ({ formData, order, ...params }) =>
                    apiFetchAuthorized(`ordersFood/${order}/`, {
                      ...params,
                      body: JSON.stringify(formData),
                      method: 'PATCH'
                  Severity: Major
                  Found in src/api.js and 1 other location - About 1 hr to fix
                  src/api.js on lines 131..136

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 64.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Severity
                  Category
                  Status
                  Source
                  Language