codevise/pageflow

View on GitHub

Showing 451 of 1,081 total issues

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

  configure: function() {
    this.tab('general', function() {
      this.group('general', {supportsTextPositionCenter: true});

      this.input('additional_title', TextInputView);

    Function onload has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    window.onload = function() {
      browser.detectFeatures().then(function() {
        var slideshow = $('[data-role=slideshow]');
        var body = $('body');
    
    
    Severity: Minor
    Found in entry_types/paged/packages/pageflow-paged/src/frontend/boot.js - About 1 hr to fix

      Function LegalInfoMenu has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function LegalInfoMenu(props) {
        const fileRights = useFileRights();
        const legalInfo = useLegalInfo();
        const credits = useCredits();
        const {t} = useI18n();

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

          Function updatePlayer has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

          export function updatePlayer(player, playerState, nextPlayerState, playerActions) {
            if (!playerState.shouldPrebuffer && nextPlayerState.shouldPrebuffer) {
              player.prebuffer().then(() => setTimeout(playerActions.prebuffered, 0));
            }
          
          

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

          export default function(videoFile, quality, {
            hasHighBandwidth, forceBestQuality, forceFullhdQuality
          } = {}) {
            quality = quality || 'auto';
          
          

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

          export function LinkTooltipProvider({
            disabled, position, children, align = 'left', gap = 10
          }) {
            const [state, setState] = useState();
            const outerRef = 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

          Function set has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            set(name, value, options) {
              const previousValue = this.get('position');
          
              Configuration.prototype.set.apply(this, arguments);
          
          

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

            save: function() {
              var publishedUntil = null;
          
              if (this.$el.hasClass('publishing')) {
                return;
          Severity: Minor
          Found in package/src/editor/views/PublishEntryView.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 initialize has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            initialize: function() {
              if (this.options.collection) {
                this.options.values = _.pluck(this.options.collection, this.options.valueProperty);
          
                if (this.options.textProperty) {
          Severity: Minor
          Found in package/src/ui/views/inputs/SelectInputView.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 PlayerSourceIDMap has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

          export const PlayerSourceIDMap = function (media, {playerOptions} = {}) {
            return {
              current: undefined,
              previous: undefined,
              mapSources: function (id, sources) {
          Severity: Minor
          Found in package/src/frontend/media/PlayerSourceIDMap.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 status_tag_row has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

                  def status_tag_row(name, texts, types)
                    row(name, class: 'status_tag_row') do |record|
                      value = record.send(name)
          
                      status = value ? 'yes' : 'no'
          Severity: Minor
          Found in lib/pageflow/active_admin_patches/views/attributes_table.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 status_tag_column has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

                  def status_tag_column(name, texts, types)
                    column name do |resource|
                      value = resource.send(name)
          
                      status = value ? 'yes' : 'no'
          Severity: Minor
          Found in lib/pageflow/active_admin_patches/views/table_for.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 History has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const History = function(slideshow, adapter) {
            slideshow.on('slideshowchangepage', function(event, options) {
              var hash = slideshow.currentPage().attr('id');
          
              if (options.back) {

            Function initialize has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              initialize: function(attributes, options) {
                options = options || {};
            
                this.metadata = new EntryMetadata(this.get('metadata') || {});
                this.metadata.parent = this;
            Severity: Minor
            Found in package/src/editor/models/Entry.js - About 1 hr to fix

              Function createScrollPositionLifecycleProvider has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function createScrollPositionLifecycleProvider(Context) {
                return function ScrollPositionLifecycleProvider({
                  children, onActivate, entersWithFadeTransition
                }) {
                  const ref = useRef();

                Function videoFileWithTextTrackFiles has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  videoFileWithTextTrackFiles: function(options) {
                    var fileTypes = this.fileTypes(function() {
                      this.withVideoFileType(options.videoFileTypeOptions);
                      this.withTextTrackFileType(options.textTrackFileTypeOptions);
                    });
                Severity: Minor
                Found in package/src/testHelpers/factories.js - About 1 hr to fix

                  Function initialize has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    initialize: function() {
                      if (this.options.collection) {
                        this.options.values = _.pluck(this.options.collection, this.options.valueProperty);
                  
                        if (this.options.textProperty) {
                  Severity: Minor
                  Found in package/src/ui/views/inputs/SelectInputView.js - About 1 hr to fix

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

                      configure: function() {
                        this.tab('general', function() {
                          this.group('general', {supportsTextPositionCenter: true});
                    
                          this.input('additional_title', TextInputView);

                      Function widgets has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const widgets = (function() {
                        return {
                          isPresent: function(name) {
                            return !!$('div.' + className(name)).length;
                          },
                      Severity: Minor
                      Found in entry_types/paged/packages/pageflow-paged/src/frontend/widgets.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language