gtkatakura/furb-learn-regex

View on GitHub

Showing 8 of 327 total issues

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

  render() {
    const { fields, meta: { touched, error, submitFailed } } = this.props;
    const currentStep = fields.get(this.state.currentStep);
    const limit = +_.get(currentStep, 'limit');

Severity: Major
Found in client/components/exercises/Steps.js - About 3 hrs to fix

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

      render() {
        const { classwork, answers, students, classRoom } = this.props;
    
        const getAnswersByStudent = (answers, student) => _.filter(answers, ['student._id', student._id]);
    
    
    Severity: Major
    Found in client/components/classRooms/ClassworkAnswers.js - About 2 hrs to fix

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

        render() {
          const colSpan = (
            1 +
            (this.props.withCreatedAt ? 1 : 0) +
            React.Children.count(this.props.children)
      Severity: Minor
      Found in client/components/ResourceTable.js - About 1 hr to fix

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

        const createEntityReducer = entityName => (state = initialValue, { type, payload }) => {
          if (type === `${entityName}_FETCH_REQUESTED`) {
            return {
              loaded: false,
              isLoading: true,
        Severity: Minor
        Found in client/reducers/core/createEntityReducer.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 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render() {
            return (
              <Fragment>
                <AddButton className="mb-2 mr-1" onClick={this.toggle} />
                <Modal isOpen={this.state.modal} toggle={this.toggle} backdrop="static">
        Severity: Minor
        Found in client/components/classworks/Modal.js - About 1 hr to fix

          Function solutionIsValid has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          const solutionIsValid = currentStep => solution => {
            if (solution) {
              const lettersFromSolution = symbolParser.parse(solution);
          
              if (lettersFromSolution.some(letter => !currentStep.symbols.includes(letter))) {
          Severity: Minor
          Found in client/validations/solutionIsValid.js - About 55 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

          Avoid too many return statements within this function.
          Open

            return state;
          Severity: Major
          Found in client/reducers/core/createEntityReducer.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return {
                  ...state,
                  entities: [
                    ...entities,
                    { ...entity, ...payload },
            Severity: Major
            Found in client/reducers/core/createEntityReducer.js - About 30 mins to fix
              Severity
              Category
              Status
              Source
              Language