codevise/pageflow

View on GitHub

Showing 407 of 1,024 total issues

Function Content has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const Content = withInlineEditingDecorator('ContentDecorator', function Content(props) {
  const [currentSectionIndex, setCurrentSectionIndexState] = useCurrentSectionIndexState();

  const entryStructure = useEntryStructure();
  useSectionChangeEvents(currentSectionIndex);
Severity: Minor
Found in entry_types/scrolled/package/src/frontend/Content.js - About 55 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 useTextTracks has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export function useTextTracks({file, defaultTextTrackFilePermaId, captionsByDefault}) {
  let [setting, setSetting] = useSetting('textTrack');
  setting = setting || {};

  const {t} = useI18n();
Severity: Minor
Found in entry_types/scrolled/package/src/frontend/useTextTracks.js - About 55 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 placeholderText has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  placeholderText: function() {
    if (!this.isDisabled() || !this.options.hidePlaceholderIfDisabled) {
      if (this.options.placeholder) {
        if (typeof this.options.placeholder == 'function') {
          return this.options.placeholder(this.model);
Severity: Minor
Found in package/src/ui/views/mixins/inputWithPlaceholderText.js - About 55 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 LinkTooltipProvider has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export function LinkTooltipProvider({editor, disabled, position, children}) {
  const [state, setState] = useState();
  const outerRef = useRef();

  const update = useMemo(() => {

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 9 (exceeds 5 allowed). Consider refactoring.
Open

  update: function() {
    var view = this;

    if (this.model.get('checking')) {
      view.ui.state.text(I18n.t('pageflow.editor.quotas.loading'));
Severity: Minor
Found in package/src/editor/views/EntryPublicationQuotaDecoratorView.js - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

  update: function() {
    if (this.videoPlayer.isPresent() && this.model.hasChanged(this.options.propertyName)) {
      var paused = this.videoPlayer.paused();

      this.videoPlayer.src(this.model.getVideoFileSources(this.options.propertyName));
Severity: Minor
Found in package/src/editor/views/embedded/LazyVideoEmbeddedView.js - About 55 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 onRender has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  onRender: function() {
    var view = this,
        options = this.options;

    SelectInputView.prototype.onRender.apply(this, arguments);
Severity: Minor
Found in package/src/ui/views/inputs/ExtendedSelectInputView.js - About 55 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 deepEqual has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function deepEqual(a, b) {
  if (a.length !== b.length) {
    return false;
  }

Severity: Minor
Found in entry_types/scrolled/package/src/frontend/MediaPlayer/PlayerContainer.js - About 55 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 ScrollButton has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export function ScrollButton({type, contentRect, onStep}) {
  const visible = type === 'start' ? contentRect.scroll.left > 0 :
                  contentRect.scroll.width > contentRect.client.width &&
                  contentRect.scroll.left < contentRect.scroll.width - contentRect.client.width;
  const step = type === 'start' ? -100 : 100;

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

export const bufferUnderrunWaiting = function(player) {
  var originalPause = player.pause;

  player.pause = function() {
    cancelWaiting();
Severity: Minor
Found in package/src/frontend/VideoPlayer/bufferUnderrunWaiting.js - About 55 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 rewrite_file_references! has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def rewrite_file_references!(hash, keys, files_by_name)
      return unless hash

      keys.each do |key|
        next unless hash[key]
Severity: Minor
Found in entry_types/scrolled/lib/pageflow_scrolled/seeds.rb - About 55 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 volumeBinding has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const volumeBinding = function(player, settings, options) {
  options = options || {};

  var originalPlay = player.play;
  var originalPause = player.pause;
Severity: Minor
Found in package/src/frontend/mediaPlayer/volumeBinding.js - About 55 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 require has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

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

Severity: Minor
Found in package/src/frontend/Consent/index.js - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

      def build(user, parent, entity_type)
        if parent.is_a?(User)
          button_label = I18n.t("pageflow.admin.#{entity_type}.add")
          path = new_admin_user_membership_path(
            parent, entity_type: to_class_name(entity_type)
Severity: Minor
Found in app/views/components/pageflow/admin/add_membership_button.rb - About 55 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 find_thumbnail has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def find_thumbnail
      candidates.detect do |candidate|
        condition = candidate[:unless] || candidate[:if]
        next if condition && !condition_met?(condition, candidate[:unless])

Severity: Minor
Found in app/models/pageflow/thumbnail_file_resolver.rb - About 55 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 _create has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  _create: function() {
    var player = this.options.player;

    var playButton = this.element.find('.vjs-play-control');
    var progressHolder = this.element.find('.vjs-progress-holder');

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(collectionName, {itemSaga, middleware}) {
  const itemsSelector = createItemsSelector(collectionName);

  return saga;

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(collectionName) {
  const itemScopeProperty = getItemScopeProperty(collectionName);

  return function connectInItemScope(mapStateToProps, mapDispatchToProps, mergeProps) {
    const connecter = connect(

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

function getAttributes(model, {attributeNames, includeConfiguration}) {
  const result = attributeNames.reduce((result, attributeName) => {
    if (typeof attributeName == 'object') {
      const key = Object.keys(attributeName)[0];
      const value = attributeName[key];
Severity: Minor
Found in entry_types/scrolled/package/src/collections.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 useIntersectionObserver has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export function useIntersectionObserver({threshold, onVisibleIndexChange}) {
  const containerRef = useRef();
  const childRefs = useRef([]);
  const observerRef = useRef();

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