codevise/pageflow

View on GitHub

Showing 407 of 1,024 total issues

Function useAutoCruising has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export function useAutoCruising({viewerRef, onCancel}) {
  const autoCruisingRef = useRef(false);
  const rafIdRef = useRef();
  const lastYawRef = useRef(null);

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

function PlayerWithControlBar({
  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 getPlayerClickHandler has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export function getPlayerClickHandler({
  configuration,
  playerActions,
  shouldPlay, lastControlledVia,
  mediaMuted,
Severity: Minor
Found in entry_types/scrolled/package/src/contentElements/inlineVideo/handlers.js - About 45 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 default has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export default function({scope = 'default'} = {}) {
  return function reducer(state = {}, action) {
    if (action.meta &&
        action.meta.mediaScope &&
        action.meta.mediaScope !== scope) {

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

function textTrackPosition(state, {playerState, textTrackPosition}) {
  if (textTrackPosition) {
    return textTrackPosition;
  }

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

export const Visited = function(entryId, pages, events, cookies) {
  var cookieName = '_pageflow_visited';

  var unvisitedPages = [];

Severity: Minor
Found in entry_types/paged/packages/pageflow-paged/src/frontend/Visited.js - About 45 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 updateRect has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

function updateRect(editor, startIndex, endIndex, outer, el, inner) {

    Function useBackdrop has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export function useBackdrop(section) {
      const videoBackdrop = useFileBackdrop({
        section,
        collectionName: 'videoFiles',
        propertyName: 'video'
    Severity: Minor
    Found in entry_types/scrolled/package/src/frontend/v1/useBackdrop.js - About 45 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 useBackdrop has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export function useBackdrop({backdrop, backdropEffects, backdropEffectsMobile}) {
      const videoFile = useBackdropFile({
        permaId: backdrop.video,
        collectionName: 'videoFiles',
        motifArea: backdrop.videoMotifArea,
    Severity: Minor
    Found in entry_types/scrolled/package/src/frontend/v2/useBackdrop.js - About 45 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 SectionDecorator has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export function SectionDecorator({backdrop, section, contentElements, transitions, children}) {
      const {t} = useI18n({locale: 'ui'});
    
      const {isSelected, select, resetSelection} = useEditorSelection({
        id: section.id,

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

      render: function() {
        var that = this;
    
        this.$el.fileupload({
          type: 'POST',
    Severity: Minor
    Found in package/src/editor/views/UploaderView.js - About 45 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 withLineBreakNormalization has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export function withLineBreakNormalization(editor) {
      const { normalizeNode } = editor;
    
      editor.normalizeNode = ([node, path]) => {
        if (path.length === 0 && editor.children.length > 1) {

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

    export function DefaultNavigation({configuration}) {
      const [navExpanded, setNavExpanded] = useState(true);
      const [mobileNavHidden, setMobileNavHidden] = useState(true);
      const [readingProgress, setReadingProgress] = useState(0);
      const chapters = useChapters();

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

      allocatePlayer({
        playerType, playerId, playsInline, mediaEventsContextData,
        hooks, poster, loop = false, controls = false, altText,
        onRelease
      }) {
    Severity: Minor
    Found in package/src/frontend/media/MediaPool.js - About 45 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 setItemCookieString has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    export function setItemCookieString(key, value, expiresOrOptions, path, domain, secure) {
    Severity: Minor
    Found in package/src/frontend/cookies.js - About 45 mins to fix

      Method build_folder_list has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

            def build_folder_list(folders)
              ul(class: 'folders') do
                folders.each do |folder|
                  li('data-id' => folder.id) do
                    text_node(link_to_folder(folder))
      Severity: Minor
      Found in app/views/components/pageflow/admin/grouped_folder_list.rb - About 45 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 navigation_bar_css_class has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def navigation_bar_css_class(entry, options = {})
            [
              options[:class],
              entry.home_button.enabled? ? 'with_home_button' : nil,
              entry.overview_button.enabled? ? 'with_overview_button' : nil,
      Severity: Minor
      Found in app/helpers/pageflow/navigation_bar_helper.rb - About 45 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 pageflow_default_abilities has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def pageflow_default_abilities(user)
            return if user.nil?
      
            can :read, Account, AccountPolicy::Scope.new(user, Account).resolve do |account|
              AccountPolicy.new(user, account).read?
      Severity: Minor
      Found in lib/pageflow/ability_mixin.rb - About 45 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 build has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

            def build(site)
              table_subjects = site.existing_and_potential_entry_templates
      
              table_for(table_subjects, i18n: Pageflow::EntryTemplate) do
                column do |entry_template|
      Severity: Minor
      Found in app/views/components/pageflow/admin/entry_templates_tab.rb - About 45 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 call has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def call(image_file, entry:)
            {
              default: {
                desktop: image_file.ready? ? image_file.attachment.url(desktop_style(entry)) : '',
                mobile: image_file.ready? ? image_file.attachment.url(:medium) : ''
      Severity: Minor
      Found in app/models/pageflow/image_file_css_background_image_urls.rb - About 45 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