codevise/pageflow

View on GitHub

Showing 451 of 1,081 total issues

Function prebuffer has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  player.prebuffer = function(options) {
    options = options || {};

    const delta = options.secondsToBuffer || 10;
    const secondsToWait = options.secondsToWait || 3;
Severity: Minor
Found in package/src/frontend/VideoPlayer/prebuffering.js - About 1 hr to fix

    Function StorylineOrdering has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    export const StorylineOrdering = function(storylines, pages) {
      var storylinesByParent;
    
      this.watch = function() {
        storylines.on('add change:configuration', function() {
    Severity: Minor
    Found in package/src/editor/models/StorylineOrdering.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 withCustomInsertBreak has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    export function withCustomInsertBreak(editor) {
      const {insertBreak} = editor;
    
      editor.insertBreak = function() {
        const {selection} = editor;

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

        def show
          respond_to do |format|
            format.html do
              entry = find_by_permalink || find_by_slug
    
    
    Severity: Minor
    Found in app/controllers/pageflow/entries_controller.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

    Method membership has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def membership(attributes)
          if (attributes[:entry].present? && attributes[:entity].present?) ||
             (attributes[:account].present? && attributes[:entity].present?)
            say_attribute_precedence(':entity', ':entry and :account')
          end
    Severity: Minor
    Found in lib/pageflow/seeds.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

    Method video_file_video_tag has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def video_file_video_tag(video_file, options = {})
          defaults = {
            crossorigin: 'anonymous',
            class: [
              'player video-js video-viewport vjs-default-skin',
    Severity: Minor
    Found in app/helpers/pageflow/video_files_helper.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 update has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

      update: function() {
        if (this.model) {
          if (_.isFunction(this.model.thumbnailFile)) {
            var file = this.model && this.model.thumbnailFile();
    
    
    Severity: Minor
    Found in package/src/editor/views/ModelThumbnailView.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 PlayerControls has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function PlayerControls(props) {
      return (
        <Container {...props} >
          <span className="hint">{props.hint}</span>
    
    

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

      export default function(videoFile, fit, position, wrapperDimensions) {
        if (!wrapperDimensions || !wrapperDimensions.height ||
            !fit || fit == 'contain') {
          return;
        }

        Function SimulatedAdapter has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const SimulatedAdapter = function() {
          var stack = [{
            hash: null,
            state: null
          }];

          Function configure has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            configure: function(configurationEditor, storylineChildPages) {
              configurationEditor.tab('general', function() {
                this.input('title', TextInputView);
                this.input('main', CheckBoxInputView, {
                  disabled: true,

            Function MotifArea has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const MotifArea = function MotifArea(props) {
              const lastPosition = useRef();
              const position = props.file?.isReady && getPosition(props);
              const visible = useContext(MotifAreaVisibilityContext);
            
            
            Severity: Minor
            Found in entry_types/scrolled/package/src/frontend/v1/MotifArea.js - About 1 hr to fix

              Function handleDrop has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function handleDrop(item, index) {
                  if (index === 0) {
                    postMoveContentElementMessage({
                      id: item.id,
                      range: item.range,

                Function centerPosters has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function centerPosters() {
                    $('.vjs-poster img').each(function() {
                      var img = $(this),
                          imgWidth = img.width(),
                          imgHeight = img.height(),
                Severity: Minor
                Found in app/assets/javascripts/pageflow/lt_ie9.js - About 1 hr to fix

                  Function mediaEvents has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const mediaEvents = function(player, context) {
                  
                    player.updateMediaEventsContext = function (newContext) {
                      context = newContext;
                    }
                  Severity: Minor
                  Found in package/src/frontend/VideoPlayer/mediaEvents.js - About 1 hr to fix

                    Function update has 31 lines of code (exceeds 25 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 1 hr to fix

                      Function _dropDownMenuItems has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        _dropDownMenuItems: function() {
                          var file = this._getFile(file);
                          var items = new Backbone.Collection();
                      
                          if (this.options.defaultTextTrackFilePropertyName && file) {
                      Severity: Minor
                      Found in package/src/editor/views/inputs/FileInputView.js - About 1 hr to fix

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

                            _create: function() {
                              var widget = this;
                        
                              function show() {
                                widget.element.show();

                          Function navigationDirection has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const navigationDirection = (function() {
                            var eventMapping = {
                              v: {
                                scrollerbumpnext: 'scrollerbumpdown',
                                scrollerbumpback: 'scrollerbumpup',

                            Function polygonCentroid has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function polygonCentroid(points) {
                              let centroidX = 0;
                              let centroidY = 0;
                              let signedArea = 0;
                              let x0 = 0;
                              Severity
                              Category
                              Status
                              Source
                              Language