codevise/pageflow

View on GitHub

Showing 425 of 1,055 total issues

Method make has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def make
        source = @file
        filename = [@basename, '.webp'].join
        destination = Paperclip::TempfileFactory.new.generate(filename)

Severity: Minor
Found in lib/pageflow/paperclip_processors/webp.rb - About 35 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;

    Avoid too many return statements within this function.
    Open

          return {
            ...state,
            points,
            potentialPoint: null,
            indicatorPosition: ensureInPolygon(points, state.indicatorPosition)

      Avoid too many return statements within this function.
      Open

            return {
              ...state,
              potentialPointInsertIndex: index,
              potentialPoint
            };

        Avoid too many return statements within this function.
        Open

              return state;

          Avoid too many return statements within this function.
          Open

                return {
                  ...state,
                  indicatorPosition: ensureInPolygon(state.points, state.indicatorPosition)
                };

            Avoid too many return statements within this function.
            Open

                    return state;

              Avoid too many return statements within this function.
              Open

                  return () => {
                    if (shouldPlay && mediaMuted) {
                      if (configuration.rewindOnUnmute && lastControlledVia === 'autoplay') {
                        playerActions.seekTo(0);
                      }
              Severity: Major
              Found in entry_types/scrolled/package/src/contentElements/inlineVideo/handlers.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return motifAreaDimension.top + motifAreaDimension.height
                Severity: Major
                Found in entry_types/scrolled/package/src/frontend/v1/useMotifAreaState.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return -1;
                  Severity: Major
                  Found in package/src/editor/collections/PagesCollection.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return 1;
                    Severity: Major
                    Found in package/src/editor/collections/PagesCollection.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return 0;

                        Avoid too many return statements within this function.
                        Open

                              return 0;
                        Severity: Major
                        Found in package/src/editor/collections/PagesCollection.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return result;
                          Severity: Major
                          Found in entry_types/scrolled/package/src/frontend/VideoPlayer/sources.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                  return 'Der Server ist nicht erreichbar.';
                            Severity: Major
                            Found in package/src/editor/models/mixins/failureTracking.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return 'Der Server hat einen internen Fehler gemeldet.';
                              Severity: Major
                              Found in package/src/editor/models/mixins/failureTracking.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                    return [
                                      {
                                        type: 'video/mp4',
                                        src: videoFile.urls[quality]
                                      }
                                Severity: Major
                                Found in entry_types/scrolled/package/src/frontend/VideoPlayer/sources.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                      return motifAreaDimension.height
                                  Severity: Major
                                  Found in entry_types/scrolled/package/src/frontend/v1/useMotifAreaState.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                        return '';
                                    Severity: Major
                                    Found in package/src/editor/models/mixins/failureTracking.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                              return Promise.resolve('failed');
                                      Severity: Major
                                      Found in package/src/frontend/Consent/index.js - About 30 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language