codevise/pageflow

View on GitHub

Showing 392 of 1,004 total issues

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

  fadeSound: function(media, endVolume, fadeTime) {
    var fadeResolution = 10;
    var startVolume = media.volume();
    var steps = fadeTime / fadeResolution;
    var leap = (endVolume - startVolume) / steps;

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 Player has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function Player({
  videoFile, posterImageFile,
  inlineFileRightsItems,
  playerState, playerActions,
  contentElementId, configuration

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 selfClear has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function selfClear(items, index) {
  const item = items[index];
  const next = items[index + 1];

  if (supportsWrappingAroundFloats(item) ||
Severity: Minor
Found in entry_types/scrolled/package/src/frontend/layouts/Center.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 History has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const History = function(slideshow, adapter) {
  slideshow.on('slideshowchangepage', function(event, options) {
    var hash = slideshow.currentPage().attr('id');

    if (options.back) {

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

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 comparator has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  comparator: function(pageA, pageB) {
    if (pageA.storylinePosition() > pageB.storylinePosition()) {
      return 1;
    }
    else if (pageA.storylinePosition() < pageB.storylinePosition()) {
Severity: Minor
Found in package/src/editor/collections/PagesCollection.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 translateStatus has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  translateStatus: function(xhr) {
    if (xhr.status === 401) {
      return 'Sie müssen angemeldet sein, um diese Aktion auszuführen.';
    }
    else if (xhr.status === 403) {
Severity: Minor
Found in package/src/editor/models/mixins/failureTracking.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 update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  update: function() {
    if (this.model) {
      var stage = this.model.currentStage();

      if (stage) {
Severity: Minor
Found in package/src/editor/views/FileThumbnailView.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 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 initialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  initialize: function() {
    this.listenTo(this, 'change:main', function(model, value) {
      if (value) {
        this.each(function(storyline) {
          if (storyline.isMain() && storyline !== model) {
Severity: Minor
Found in package/src/editor/collections/StorylinesCollection.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 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

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 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 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

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

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

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 0;

      Avoid too many return statements within this function.
      Open

            return state;
        Severity
        Category
        Status
        Source
        Language