codevise/pageflow

View on GitHub

Showing 1,024 of 1,024 total issues

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

  it('sets collectionName', () => {
    const files = {'video_files': [{id: 5, perma_id: 50, variants: ['high']}]};
    const modelTypes = {'video_files': 'Pageflow::VideoFile'};
    const state = sample({files, modelTypes});

entry_types/paged/packages/pageflow-paged-react/src/files/__spec__/selectors-spec.js on lines 42..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 119.

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('sets modelType from mapping', () => {
    const files = {'video_files': [{id: 5, perma_id: 50, variants: ['high']}]};
    const modelTypes = {'video_files': 'Pageflow::VideoFile'};
    const state = sample({files, modelTypes});

entry_types/paged/packages/pageflow-paged-react/src/files/__spec__/selectors-spec.js on lines 52..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 119.

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('updates an item', () => {
        const state = {
          items: {
            2: {id: 2, title: 'News'}
          }
entry_types/paged/packages/pageflow-paged-react/src/collections/__spec__/createReducer-spec.js on lines 181..195

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 119.

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 actions for other collection', () => {
        const state = {
          items: {
            2: {id: 2, title: 'Old'}
          }
entry_types/paged/packages/pageflow-paged-react/src/collections/__spec__/createReducer-spec.js on lines 132..146

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 119.

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

`` has 33 functions (exceeds 20 allowed). Consider refactoring.
Open

  return {
    playBlessed({via} = {}){
      media.mute(false);
      dispatch({type: PLAY, payload: {via}});
    },

    Function Selection has 104 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function Selection(props) {
      const editor = useSlate();
      const {t} = useI18n({locale: 'ui'});
    
      const ref = useRef()

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

          _create: function() {
            var element = this.element;
            var options = this.options;
            var scroller = options.scroller;
            var links = element.find('a[href]');

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

          onRender: function() {
            this.options.fileTypes.each(function(fileType) {
              this.ui.filesPanel.append(this.subview(new UploadableFilesView({
                collection: this.options.files[fileType.collectionName],
                fileType: fileType,
        Severity: Major
        Found in package/src/editor/views/ConfirmUploadView.js and 1 other location - About 4 hrs to fix
        package/src/editor/views/ConfirmFileImportUploadView.js on lines 48..58

        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 117.

        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

          onRender: function() {
            this.options.fileTypes.each(function(fileType) {
              this.ui.filesPanel.append(this.subview(new UploadableFilesView({
                collection: this.options.files[fileType.collectionName],
                fileType: fileType,
        Severity: Major
        Found in package/src/editor/views/ConfirmFileImportUploadView.js and 1 other location - About 4 hrs to fix
        package/src/editor/views/ConfirmUploadView.js on lines 38..48

        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 117.

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

            _create: function() {
              var that = this,
                scroller,
                chapterParts = $('.ov_chapter', this.element),
                pages = $('.ov_page', this.element),

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

                <Effects file={video}>
                  <PlayerEventContextDataProvider playerDescription="Backdrop Video"
                                                  playbackMode="loop">
                    <VideoPlayer load={shouldPrepare ? 'auto' :
                                       shouldLoad ? 'poster' :
          entry_types/scrolled/package/src/frontend/v1/Backdrop/BackgroundVideo.js on lines 48..62

          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 116.

          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

                <Effects file={video}>
                  <PlayerEventContextDataProvider playerDescription="Backdrop Video"
                                                  playbackMode="loop">
                    <VideoPlayer load={shouldPrepare ? 'auto' :
                                       shouldLoad ? 'poster' :
          entry_types/scrolled/package/src/frontend/v2/Backdrop/BackgroundVideo.js on lines 48..62

          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 116.

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

            _create: function() {
              var player = this.options.player;
          
              var playButton = this.element.find('.vjs-play-control');
              var progressHolder = this.element.find('.vjs-progress-holder');

            Function StorylineOrdering has 96 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const StorylineOrdering = function(storylines, pages) {
              var storylinesByParent;
            
              this.watch = function() {
                storylines.on('add change:configuration', function() {
            Severity: Major
            Found in package/src/editor/models/StorylineOrdering.js - About 3 hrs to fix

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

                const {shouldLoad, shouldPrepare} = useSectionLifecycle({
                  onVisible() {
                    playerActions.changeVolumeFactor(0, 0);
                    playerActions.play()
                  },
              entry_types/scrolled/package/src/frontend/v1/Backdrop/BackgroundVideo.js on lines 13..30

              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 111.

              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

                const {shouldLoad, shouldPrepare} = useSectionLifecycle({
                  onVisible() {
                    playerActions.changeVolumeFactor(0, 0);
                    playerActions.play()
                  },
              entry_types/scrolled/package/src/frontend/v2/Backdrop/BackgroundVideo.js on lines 13..30

              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 111.

              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

                    if (this.options.textProperty) {
                      this.options.texts = _.pluck(this.options.collection, this.options.textProperty);
                    }
                    else if (this.options.translationKeyProperty) {
                      this.options.translationKeys = _.pluck(this.options.collection, this.options.translationKeyProperty);
              Severity: Major
              Found in package/src/ui/views/inputs/SelectInputView.js and 2 other locations - About 3 hrs to fix
              package/src/ui/views/inputs/ExtendedSelectInputView.js on lines 14..19
              package/src/ui/views/inputs/SelectInputView.js on lines 114..119

              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 111.

              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

                    if (this.options.groupProperty) {
                      this.options.groups = _.pluck(this.options.collection, this.options.groupProperty);
                    }
                    else if (this.options.groupTranslationKeyProperty) {
                      this.options.groupTanslationKeys = _.pluck(this.options.collection, this.options.groupTranslationKeyProperty);
              Severity: Major
              Found in package/src/ui/views/inputs/SelectInputView.js and 2 other locations - About 3 hrs to fix
              package/src/ui/views/inputs/ExtendedSelectInputView.js on lines 14..19
              package/src/ui/views/inputs/SelectInputView.js on lines 107..112

              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 111.

              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

                    if (this.options.descriptionProperty) {
                      this.options.descriptions = _.pluck(this.options.collection, this.options.descriptionProperty);
                    }
                    else if (this.options.descriptionTranslationKeyProperty) {
                      this.options.descriptionTanslationKeys = _.pluck(this.options.collection, this.options.descriptionTranslationKeyProperty);
              Severity: Major
              Found in package/src/ui/views/inputs/ExtendedSelectInputView.js and 2 other locations - About 3 hrs to fix
              package/src/ui/views/inputs/SelectInputView.js on lines 107..112
              package/src/ui/views/inputs/SelectInputView.js on lines 114..119

              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 111.

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

              export const Lazy = function(template, options) {
                var placeholder = $('<span class="video_placeholder" />'),
                    that = this,
                    readyCallbacks = new $.Callbacks(),
                    disposeTimeout, videoTag, videoPlayer, html;
                Severity
                Category
                Status
                Source
                Language