just-paja/improtresk-web

View on GitHub

Showing 46 of 176 total issues

Avoid too many return statements within this function.
Open

    return <Label className='mb-0 text-success'><Message name='orders.paid' /></Label>
Severity: Major
Found in src/orders/components/OrderStatusLabel.jsx - About 30 mins to fix

    Function interceptInvalidWorkshopChange has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    export function * interceptInvalidWorkshopChange () {
      const form = yield select(getFormValues, orderChange.form)
      const order = yield select(getActiveOrder)
      const workshops = yield select(getWorkshopList)
      const selectedWorkshop = workshops.find(workshop => workshop.id === form.workshop)
    Severity: Minor
    Found in src/orders/sagas/orderOperations.js - About 25 mins 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 OrderAccomodation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    const OrderAccomodation = ({
      order,
      participant,
      roomChoice
    }) => {
    Severity: Minor
    Found in src/orders/components/OrderAccomodationStatus.jsx - About 25 mins 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 getFetchResultAction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    function * getFetchResultAction (routine, response, actionData) {
      let responseBody = null
      if (response && response.status === 404) {
        return routine.failure({ missing: true }, actionData)
      }
    Severity: Minor
    Found in src/sagas/fetchResource.js - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
    Open

      render () {
        let errors
        if (this.props.error) {
          if (this.props.error instanceof Array) {
            errors = this.props.error
    Severity: Minor
    Found in src/forms/components/Form.jsx - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
    Open

      render () {
        const {
          closed,
          description,
          disabled,
    Severity: Minor
    Found in src/polls/components/PollAnswer.jsx - About 25 mins 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