codevise/pageflow

View on GitHub

Showing 391 of 1,006 total issues

Function update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  update: function() {
    this.$el.toggleClass('files_pending', this.model.get('uploading_files_count') > 0 || this.model.get('pending_files_count') > 0);
    this.$el.toggleClass('published', this.model.get('published'));

    this.ui.revisionsLink.attr('href', '/admin/entries/' + this.model.id);
Severity: Minor
Found in package/src/editor/views/PublishEntryView.js - 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

Function playerStateReducer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function playerStateReducer(state, action){
  switch(action.type){
    case PLAY:
      return {
        ...state,
Severity: Minor
Found in entry_types/scrolled/package/src/frontend/MediaPlayer/usePlayerState.js - 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

Function getMotifAreaMinHeight has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function getMotifAreaMinHeight(fullHeight, transitions) {
  if (fullHeight) {
    return;
  }

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

Function show has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  show: function(text, position, options) {
    options = options || {};
    this.visible = true;

    clearTimeout(this.timeout);
Severity: Minor
Found in package/src/ui/views/TooltipView.js - 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

Function OptIn has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function OptIn({children, providerName, wrapper, icon}) {
  const {t} = useI18n();
  const {contentElementId} = useContentElementAttributes();
  const contentElementConsentVendor = useContentElementConsentVendor({contentElementId});

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

Function resume has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  resume() {
    if (this.multiPlayer.paused()) {
      if (this.disabled || this.backgroundMedia.muted) {
        return Promise.resolve();
      }
Severity: Minor
Found in entry_types/scrolled/package/src/frontend/Atmo.js - 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

Function MediaPlayerControls has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function MediaPlayerControls(props) {
  const playerState = props.playerState;
  const playerActions = props.playerActions;

  const {t} = useI18n();
Severity: Minor
Found in entry_types/scrolled/package/src/frontend/MediaPlayerControls.js - 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

Function renderLink has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function renderLink({attributes, children, element}) {
  if (element?.href?.chapter) {
    const {key, ...otherAttributes} = attributes;

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

Function Figure has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function Figure({
  children,
  caption, onCaptionChange,
  addCaptionButtonVisible = true, addCaptionButtonPosition = 'outside'
}) {
Severity: Minor
Found in entry_types/scrolled/package/src/frontend/Figure.js - 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

Function pageflowScrolledRegisterUpdateSeedHandler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

global.pageflowScrolledRegisterUpdateSeedHandler = function() {
  if (window.parent !== window) {
    window.addEventListener('message', receive);
  }

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

Function _updateText has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  _updateText: function() {
    if (this.attributeValue()) {
      return this.attributeValue();
    }
    else if (typeof this.options.column.default === 'function') {
Severity: Minor
Found in package/src/ui/views/tableCells/TextTableCellView.js - 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

Function requireAccepted has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  requireAccepted(vendorName) {
    if (this.inEditor) {
      return Promise.resolve('fulfilled');
    }

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

Function FullscreenViewer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function FullscreenViewer({
  contentElementId,
  renderChildren,
  renderFullscreenChildren
}) {
Severity: Minor
Found in entry_types/scrolled/package/src/frontend/FullscreenViewer/index.js - 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

Function mouseover [data-tooltip] has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    'mouseover [data-tooltip]': function(event) {
      if (!this.tooltip.visible) {
        var target = $(event.currentTarget);
        var key = target.attr('data-tooltip');
        var position;
Severity: Minor
Found in package/src/ui/views/mixins/tooltipContainer.js - 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

Function Audio has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const Audio = function(options) {
  this.getSources = options.getSources || function(audioFileId) {
    return options.audioFiles[audioFileId] || '';
  };

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

Function ScrollPointMessageHandler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function ScrollPointMessageHandler() {
  const scrollPoint = useRef();

  const receiveMessage = useCallback(data => {
    if (data.type === 'SAVE_SCROLL_POINT') {
Severity: Minor
Found in entry_types/scrolled/package/src/frontend/inlineEditing/scrollPoints.js - 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

Function displayValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  displayValue: function() {
    if (this.isDisabled() && this.options.displayUncheckedIfDisabled) {
      return false;
    }
    else if (this.isDisabled() && this.options.displayCheckedIfDisabled) {
Severity: Minor
Found in package/src/ui/views/inputs/CheckBoxInputView.js - 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

Function useBackdrop has a Cognitive Complexity of 6 (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 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

Function appendOptions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  appendOptions: function() {
    _.each(this.options.values, function(value, index) {
      var option = document.createElement('option');
      var group = this.options.groups[index];

Severity: Minor
Found in package/src/ui/views/inputs/SelectInputView.js - 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

Function createScrollPositionLifecycleProvider has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function createScrollPositionLifecycleProvider(Context) {
  return function ScrollPositionLifecycleProvider({
    children, onActivate, entersWithFadeTransition
  }) {
    const ref = useRef();
Severity: Minor
Found in entry_types/scrolled/package/src/frontend/useScrollPositionLifecycle.js - 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