learningtapestry/lcms-engine

View on GitHub

Showing 10 of 20 total issues

Avoid too many return statements within this method.
Open

      return false if g2_u6 && %w(6 11 12 13).include?(@opts[:metadata]['lesson'])
Severity: Major
Found in lib/doc_template/document.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

          return false if g2_u10 && %w(11 13 5 12).include?(@opts[:metadata]['lesson'])
    Severity: Major
    Found in lib/doc_template/document.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

            return false if g2_u11 && %w(14 12 7 13).include?(@opts[:metadata]['lesson'])
      Severity: Major
      Found in lib/doc_template/document.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

              return false if g2_u5 && %w(5 10 11 12).include?(@opts[:metadata]['lesson'])
        Severity: Major
        Found in lib/doc_template/document.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                return false if g2_u8 && %w(5 12 11 10).include?(@opts[:metadata]['lesson'])
          Severity: Major
          Found in lib/doc_template/document.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                  return false if g2_u7 && %w(6 11 12 13).include?(@opts[:metadata]['lesson'])
            Severity: Major
            Found in lib/doc_template/document.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                    return false if g2_u4 && %w(8 13 14 15).include?(@opts[:metadata]['lesson'])
              Severity: Major
              Found in lib/doc_template/document.rb - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                      return false if g2_u9 && %w(15 14 13 6).include?(@opts[:metadata]['lesson'])
                Severity: Major
                Found in lib/doc_template/document.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                        return false if g2_u12 && %w(12 13 6 11).include?(@opts[:metadata]['lesson'])
                  Severity: Major
                  Found in lib/doc_template/document.rb - About 30 mins to fix

                    Function render has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
                    Open

                      render() {
                        const waitingCount = _.filter(this.state.jobs, job => job.status !== 'done').length;
                        const importedCount = _.filter(this.state.jobs, job => job.status === 'done' && job.ok).length;
                        const failedCount = _.filter(this.state.jobs, job => job.status === 'done' && !job.ok).length;
                    
                    
                    Severity: Minor
                    Found in app/javascript/components/admin/ImportStatus.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