codevise/pageflow

View on GitHub

Showing 407 of 1,024 total issues

Function VideoPlayer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function VideoPlayer({videoFile, posterImageFile, ...props}) {
  const [activeQuality] = useVideoQualitySetting();
  const textTracks = useTextTracks({
    file: videoFile,
    defaultTextTrackFilePermaId: props.defaultTextTrackFilePermaId,
Severity: Minor
Found in entry_types/scrolled/package/src/frontend/VideoPlayer/index.js - 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

Function useBackgroundFile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function useBackgroundFile({file, motifArea, containerDimension, effects}) {
  if (!file) {
    return null ;
  }

Severity: Minor
Found in entry_types/scrolled/package/src/frontend/v1/useBackgroundFile.js - 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

Function heightMode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function heightMode(section) {
  if (section.fullHeight) {
    if ((section.transition.startsWith('fade') && section.previousSection) ||
        (section.nextSection && section.nextSection.transition.startsWith('fade'))) {
      return 'fullFade';
Severity: Minor
Found in entry_types/scrolled/package/src/frontend/Section.js - 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

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

Function filterSources has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const filterSources = function(playerElement) {
  if (playerElement.tagName.toLowerCase() !== 'video') {
    return playerElement;
  }

Severity: Minor
Found in package/src/frontend/VideoPlayer/filterSources.js - 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

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

    def poll_zencoder(file, api)
      info = api.get_info(file.job_id)

      file.encoding_progress = info[:finished] ? 100 : info[:progress];
      file.encoding_error_message = nil
Severity: Minor
Found in app/jobs/pageflow/poll_zencoder_job.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

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

    def get_details(job_id)
      with_exception_translation do
        response = Zencoder::Job.details(job_id)

        if response.success?
Severity: Minor
Found in lib/pageflow/zencoder_api.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

Function cueSettingsMethods has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const cueSettingsMethods = function(player) {
  /**
   * Specify the display position of text tracks. This method can also
   * be used to make VideoJS reposition the text tracks after the
   * margins of the text track display have been changed (e.g. to
Severity: Minor
Found in package/src/frontend/VideoPlayer/cueSettingsMethods.js - 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

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

      def all
        initial_widgets = placeholders_by_role.merge(defaults_by_role)
        initial_widgets.merge(from_db_by_role) { |_role_key, old_val, new_val|
          if old_val.configuration.present?
            new_val.configuration = {} if new_val.configuration.nil?
Severity: Minor
Found in app/models/pageflow/widget.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 () => {
      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 state;

      Avoid too many return statements within this function.
      Open

            return 0;

        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 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 [
                    {
                      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 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 -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 '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 motifAreaDimension.top + motifAreaDimension.height
                      Severity: Major
                      Found in entry_types/scrolled/package/src/frontend/v1/useMotifAreaState.js - About 30 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language