codevise/pageflow

View on GitHub

Showing 1,004 of 1,004 total issues

Function reducer has 229 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  return function reducer(state = {}, action) {
    if (action.meta &&
        action.meta.mediaScope &&
        action.meta.mediaScope !== scope) {
      return state;

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

        _create: function() {
          var element = this.element,
              overlays = element.find('.navigation_site_detail'),
              toggleIndicators = function() {};
    
    

      Method pageflow_default_abilities has 218 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def pageflow_default_abilities(user)
            return if user.nil?
      
            can :read, Account, AccountPolicy::Scope.new(user, Account).resolve do |account|
              AccountPolicy.new(user, account).read?
      Severity: Major
      Found in lib/pageflow/ability_mixin.rb - About 1 day to fix

        Function playerStateReducer has 210 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function playerStateReducer(state, action){
          switch(action.type){
            case PLAY:
              return {
                ...state,

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          export function formatTimeDuration(durationInMs) {
            const seconds = Math.round(durationInMs / 1000) % 60;
            const minutes = Math.floor(durationInMs / 1000 / 60) % 60;
            const hours = Math.floor(durationInMs / 1000 / 60 / 60);
          
          
          Severity: Major
          Found in entry_types/scrolled/package/src/frontend/utils/iso8601.js and 1 other location - About 1 day to fix
          entry_types/paged/packages/pageflow-paged-react/src/utils/iso8601.js on lines 1..21

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 196.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          export function formatTimeDuration(durationInMs) {
            const seconds = Math.round(durationInMs / 1000) % 60;
            const minutes = Math.floor(durationInMs / 1000 / 60) % 60;
            const hours = Math.floor(durationInMs / 1000 / 60 / 60);
          
          
          entry_types/scrolled/package/src/frontend/utils/iso8601.js on lines 1..21

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 196.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

            describe('with videoPropertyBaseName', () => {
              it('uses custom id property', () => {
                const page = {
                  videoId: 5
                };
          entry_types/paged/packages/pageflow-paged-react/src/components/__spec__/PageBackgroundImage-spec.jsx on lines 29..51
          entry_types/paged/packages/pageflow-paged-react/src/components/__spec__/PageBackgroundImage-spec.jsx on lines 53..75

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 184.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

            describe('with propertyBaseName', () => {
              it('uses custom id property', () => {
                const page = {
                  imageId: 5
                };
          entry_types/paged/packages/pageflow-paged-react/src/components/__spec__/PageBackgroundImage-spec.jsx on lines 53..75
          entry_types/paged/packages/pageflow-paged-react/src/media/components/__spec__/PageVideoPlayer-spec.jsx on lines 38..60

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 184.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

            describe('with propertyNamePrefix', () => {
              it('uses custom id property', () => {
                const page = {
                  fallbackBackgroundImageId: 5
                };
          entry_types/paged/packages/pageflow-paged-react/src/components/__spec__/PageBackgroundImage-spec.jsx on lines 29..51
          entry_types/paged/packages/pageflow-paged-react/src/media/components/__spec__/PageVideoPlayer-spec.jsx on lines 38..60

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 184.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Function Batch has 181 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function Batch(entry, section) {
            // Shallow copy of the section's list of content elements to store
            // ordering changes and newly inserted content elements.
            const contentElements = section.contentElements.toArray();
          
          
          Severity: Major
          Found in entry_types/scrolled/package/src/editor/models/ScrolledEntry/Batch.js - About 7 hrs to fix

            Function Slideshow has 173 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const Slideshow = function($el, configurations) {
              var transitioning = false,
                  currentPage = $(),
                  pages = $(),
                  that = this,

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                  if (!this.options.texts) {
                    if (!this.options.translationKeys) {
                      var translationKeyPrefix = this.options.translationKeyPrefix ||
                        findKeyWithTranslation(this.attributeTranslationKeys('values', {
                          fallbackPrefix: 'activerecord.values'
              Severity: Major
              Found in package/src/ui/views/inputs/SelectInputView.js and 1 other location - About 6 hrs to fix
              package/src/ui/views/inputs/CheckBoxGroupInputView.js on lines 35..50

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 171.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                  if (!this.options.texts) {
                    if (!this.options.translationKeys) {
                      var translationKeyPrefix = this.options.translationKeyPrefix ||
                        findKeyWithTranslation(this.attributeTranslationKeys('values', {
                          fallbackPrefix: 'activerecord.values'
              Severity: Major
              Found in package/src/ui/views/inputs/CheckBoxGroupInputView.js and 1 other location - About 6 hrs to fix
              package/src/ui/views/inputs/SelectInputView.js on lines 122..137

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 171.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              File zencoder_video_output_definition.rb has 438 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              module Pageflow
                class ZencoderVideoOutputDefinition < ZencoderOutputDefinition
                  cattr_accessor :skip_hls, :skip_smil
              
                  attr_reader :video_file
              Severity: Minor
              Found in lib/pageflow/zencoder_video_output_definition.rb - About 6 hrs to fix

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                  it('returns poster url of video file thumbnail candidiate', () => {
                    const page = {
                      type: 'video',
                      videoId: 100
                    };
                entry_types/paged/packages/pageflow-paged-react/src/pages/selectors/__spec__/pageBackgroundImageUrl-spec.js on lines 9..38

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 165.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                  it('returns url of image file thumbnail candidiate', () => {
                    const page = {
                      type: 'image',
                      backgroundImageId: 100
                    };
                entry_types/paged/packages/pageflow-paged-react/src/pages/selectors/__spec__/pageBackgroundImageUrl-spec.js on lines 40..69

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 165.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                function deepEqual(a, b) {
                  if (a.length !== b.length) {
                    return false;
                  }
                
                
                entry_types/paged/packages/pageflow-paged-react/src/media/components/createFilePlayer/MediaTag.jsx on lines 126..147

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 161.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                function deepEqual(a, b) {
                  if (a.length !== b.length) {
                    return false;
                  }
                
                
                entry_types/scrolled/package/src/frontend/MediaPlayer/PlayerContainer.js on lines 68..89

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 161.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    it('ignores position', () => {
                      const videoFile = {width: 20, height: 10};
                      const fit = 'smart_contain';
                      const position = [100, 100];
                      const wrapperDimensions = {width: 210, height: 100};
                entry_types/paged/packages/pageflow-paged-react/src/media/components/VideoFilePlayer/Positioner/__spec__/getDimensions-spec.js on lines 61..73

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 158.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    it('applies y position if video is scaled to match width', () => {
                      const videoFile = {width: 20, height: 10};
                      const fit = 'cover';
                      const position = [100, 0];
                      const wrapperDimensions = {width: 400, height: 100};
                entry_types/paged/packages/pageflow-paged-react/src/media/components/VideoFilePlayer/Positioner/__spec__/getDimensions-spec.js on lines 91..103

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 158.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Severity
                Category
                Status
                Source
                Language