codevise/pageflow

View on GitHub

Showing 407 of 1,024 total issues

Function MediaPlayerControls has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

  const onTextTracksMenuItemClick = function(value) {

    Function _create has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _create: function() {
          var element = this.element;
          var scroller = this.options.scroller;
          var direction = this.options.direction;
    
    

      Function render has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render: function() {
          var that = this;
      
          this.$el.fileupload({
            type: 'POST',
      Severity: Major
      Found in package/src/editor/views/UploaderView.js - About 2 hrs to fix

        File usePlayerState.js has 251 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import {useReducer, useMemo} from 'react';
        import {createActions,
                PLAY, PLAYING, PLAY_FAILED, PAUSE, PAUSED, SCRUB_TO, SEEK_TO,
                FADE_OUT_AND_PAUSE, PLAY_AND_FADE_IN, CHANGE_VOLUME_FACTOR,
                PREBUFFER, PREBUFFERED, BUFFER_UNDERRUN, BUFFER_UNDERRUN_CONTINUE,

          Function bandwidth has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const bandwidth = function() {
            var maxLoadTime = 5000;
          
            bandwidth.promise =   bandwidth.promise || new $.Deferred(function(deferred) {
              var smallFileUrl = assetUrls.smallBandwidthProbe + "?" + new Date().getTime(),
          Severity: Minor
          Found in entry_types/paged/packages/pageflow-paged/src/frontend/bandwidth.js - About 2 hrs to fix

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

              onRender: function() {
                this.ui.input.addClass(this.options.size);
                this.load();
                this.updatePlaceholder();
            
            
            Severity: Minor
            Found in package/src/ui/views/inputs/TextAreaInputView.js - About 2 hrs to fix

              Function bufferUnderrunWaiting has 50 lines of code (exceeds 25 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 2 hrs to fix

                Function interval has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const interval = function(player) {
                  const originalVolume = player.volume;
                
                  let fadeVolumeResolve;
                  let fadeVolumeInterval;
                Severity: Minor
                Found in package/src/frontend/mediaPlayer/volumeFading/interval.js - About 2 hrs to fix

                  Function configurationEditor has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    configurationEditor({entry}) {
                      const locale = entry.metadata.get('locale');
                      this.tab('general', function() {
                        this.input('targetValue', NumberInputView, {locale});
                        this.input('decimalPlaces', SelectInputView, {
                  Severity: Minor
                  Found in entry_types/scrolled/package/src/contentElements/counter/editor.js - About 1 hr to fix

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

                    export default function(collectionName) {
                      const itemScopeProperty = getItemScopeProperty(collectionName);
                    
                      return function connectInItemScope(mapStateToProps, mapDispatchToProps, mergeProps) {
                        const connecter = connect(

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

                            def build(entry)
                              embedded_index_table(entry.memberships.includes(:user).references(:users),
                                                   blank_slate_text: I18n.t('pageflow.admin.entries.no_members')) do
                                table_for_collection class: 'memberships', sortable: true, i18n: Pageflow::Membership do
                                  column :user, sortable: 'users.last_name', class: 'name' do |membership|
                      Severity: Minor
                      Found in app/views/components/pageflow/admin/members_tab.rb - About 1 hr to fix

                        Function groupItemsByPosition has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function groupItemsByPosition(items, shouldInline) {
                          const groups = [];
                        
                          let lastInlineBox = null;
                          let currentGroup, currentBox;
                        Severity: Minor
                        Found in entry_types/scrolled/package/src/frontend/layouts/TwoColumn.js - About 1 hr to fix

                          Function ExternalLink has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function ExternalLink(props) {
                            const [hideTooltip, setHideTooltip] = useState(true);
                            var {layout} = props.sectionProps;
                            const {t} = useI18n({locale: 'ui'});
                            const {isEditable, isSelected} = useContentElementEditorState();

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

                          Base.classMethods = function(Constructor) {
                            return {
                              find: function(viewOrParentElement) {
                                var selector = Constructor.prototype.selector;
                                var parentElement = viewOrParentElement.$el || viewOrParentElement;
                          Severity: Minor
                          Found in package/src/testHelpers/dominos/Base.js - About 1 hr 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 webAudio has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export const webAudio = function(player, audioContext) {
                            var gainNode;
                          
                            var currentResolve;
                            var currentTimeout;
                          Severity: Minor
                          Found in package/src/frontend/mediaPlayer/volumeFading/webAudio.js - About 1 hr 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 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                                def build(user)
                                  embedded_index_table(user.memberships.on_accounts
                                                         .includes(:account).references(:pageflow_accounts)
                                                         .accessible_by(current_ability, :index),
                                                       blank_slate_text: t('pageflow.admin.users.no_accounts')) do
                          Severity: Minor
                          Found in app/views/components/pageflow/admin/user_accounts_tab.rb - About 1 hr 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 AudioPlayer has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export const AudioPlayer = function(sources, options) {
                            options = options || {};
                          
                            var codecMapping = {
                              vorbis: 'audio/ogg',
                          Severity: Minor
                          Found in package/src/frontend/AudioPlayer/AudioPlayer.js - About 1 hr 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 redirect_path has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                                def redirect_path
                                  if params[:user_id].present? && authorized?(:redirect_to_user, resource.user)
                                    tab = resource.entity_type == 'Pageflow::Account' ? 'accounts' : 'entries'
                                    admin_user_path(params[:user_id], tab: tab)
                                  elsif params[:user_id].present? && authorized?(:index, resource.user)
                          Severity: Minor
                          Found in admins/pageflow/membership.rb - About 1 hr 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 withVisibilityWatching has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export default function withVisibilityWatching(Component) {
                            return class VisibilityWatcher extends React.Component {
                              constructor(props) {
                                super(props);
                          
                          

                            Function PreparedMediaPlayer has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function PreparedMediaPlayer(props){
                              let playerRef = useRef();
                              let previousPlayerState = useRef(props.playerState);
                              let eventContextData = useEventContextData();
                              let unwatchPlayer;
                            Severity: Minor
                            Found in entry_types/scrolled/package/src/frontend/MediaPlayer/index.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language