codevise/pageflow

View on GitHub

Showing 392 of 1,004 total issues

Function BeforeAfter has 75 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function BeforeAfter(configuration) {
  const {
    isActive,
    load,
    before_label,

    Function AudioPlayer has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const AudioPlayer = function(sources, options) {
      options = options || {};
    
      var codecMapping = {
        vorbis: 'audio/ogg',
    Severity: Major
    Found in package/src/frontend/AudioPlayer/AudioPlayer.js - About 2 hrs to fix

      Function Scroller has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      function Scroller({
        visibleIndex, setVisibleIndex,
        displayFullscreenToggle,
        customMargin,
        onFullscreenEnter, onFullscreenExit,

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

      export function Counter({configuration, contentElementId, contentElementWidth, sectionProps}) {
        const updateConfiguration = useContentElementConfigurationUpdate();
        const locale = useLocale();
        const {t} = useI18n({locale: 'ui'});
      
      
      Severity: Minor
      Found in entry_types/scrolled/package/src/contentElements/counter/Counter.js - About 2 hrs 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 Agent has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      export const Agent = function(userAgent) {
        return {
          matchesSilk: function() {
            return matches(/\bSilk\b/);
          },
      Severity: Minor
      Found in package/src/frontend/browser/Agent.js - About 2 hrs 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 reducer has 71 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function reducer(state, action) {
        const collectionName = action.payload.collectionName;
        const keyAttribute = action.payload.keyAttribute;
      
        switch (action.type) {
      Severity: Major
      Found in entry_types/scrolled/package/src/collections.js - About 2 hrs to fix

        Method build has 71 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def build(entry)
                embedded_index_table entry.revisions, :blank_slate_text => I18n.t('pageflow.admin.entries.no_revisions') do
                  scope(:publications)
                  scope(:publications_and_user_snapshots)
                  scope(:frozen)
        Severity: Major
        Found in app/views/components/pageflow/admin/revisions_tab.rb - About 2 hrs to fix

          File collections.js has 283 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import {useReducer} from 'react';
          import {createSelector, createSelectorCreator, defaultMemoize} from 'reselect';
          
          const PREFIX = 'PAGEFLOW_SCROLLED_COLLECTION';
          const RESET = `${PREFIX}_RESET`;
          Severity: Minor
          Found in entry_types/scrolled/package/src/collections.js - About 2 hrs to fix

            Function MultiPlayer has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

            export const MultiPlayer = function(pool, options) {
              if (options.crossFade && options.playFromBeginning) {
                throw 'pageflow.Audio.MultiPlayer: The options crossFade and playFromBeginning can not be used together at the moment.';
              }
            
            
            Severity: Minor
            Found in package/src/frontend/media/MultiPlayer.js - About 2 hrs 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 Viewer has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function Viewer({
              imageFile, viewerRef, initialYaw, initialPitch, hidePanoramaIndicator, onReady, onFullscreen
            }) {
              const elRef = useRef();
            
            
            Severity: Minor
            Found in entry_types/scrolled/package/src/frontend/Panorama/Viewer.js - About 2 hrs 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 componentDidUpdate has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

              componentDidUpdate(prevProps) {
                // update audioFile
                if (this.props.audioFile !== this.props.audioFile) {
                  this._loadAudio(this.props.audioFile, this.props.audioPeaks);
                }

            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 _initDragGestureBump has 63 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _initDragGestureBump: function() {
                  var allowUp = false,
                      allowDown = false,
                      allowLeft = false,
                      allowRight = false,

              Function validate has 63 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                validate: function(success) {
                  var view = this;
                  var options = this.options;
                  var value = this.ui.input.val();
              
              
              Severity: Major
              Found in package/src/ui/views/inputs/UrlInputView.js - About 2 hrs to fix

                Function onRender has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  onRender: function() {
                    var view = this,
                        options = this.options;
                
                    SelectInputView.prototype.onRender.apply(this, arguments);
                Severity: Major
                Found in package/src/ui/views/inputs/ExtendedSelectInputView.js - About 2 hrs to fix

                  Function prebuffering has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const prebuffering = function(player) {
                    let prebufferPromiseReject;
                  
                    player.isBufferedAhead = function(delta, silent) {
                      // video.js only gives us one time range starting from 0 here. We
                  Severity: Major
                  Found in package/src/frontend/VideoPlayer/prebuffering.js - About 2 hrs to fix

                    Method initialize has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def initialize(target_type_name = nil)
                          @target_type_name = target_type_name
                    
                          @paperclip_attachments_version = 'v1'
                          @paperclip_s3_root = 'main'
                    Severity: Major
                    Found in lib/pageflow/configuration.rb - About 2 hrs to fix

                      Function default has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function(pageflow) {
                        const isEditor = !!pageflow.storylines;
                        const isServerSide = !pageflow.settings;
                      
                        const seed = pageflow.seed;
                      Severity: Major
                      Found in entry_types/paged/packages/pageflow-paged-react/src/boot.js - About 2 hrs to fix

                        Function componentDidMount has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          componentDidMount() {
                            const options = assign({}, this.props.options, {
                              container: this.wavesurferEl
                            });
                        
                        

                          Function sources has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function sources(videoFile, quality = 'auto') {
                            if (typeof window !== 'undefined') {
                              if (!browser.has('video')) {
                                return [];
                              }
                          Severity: Major
                          Found in entry_types/scrolled/package/src/frontend/VideoPlayer/sources.js - About 2 hrs to fix

                            File appearance-stories.js has 268 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import React from 'react';
                            
                            import {
                              Entry, RootProviders,
                              contentElementWidths, contentElementWidthName,
                              Severity
                              Category
                              Status
                              Source
                              Language