superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

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

    constructor(props: IProps) {
        super(props);

        this.handleUrlUpdate = this.handleUrlUpdate.bind(this);
    }
Severity: Major
Found in scripts/apps/authoring-react/fields/urls/editor.tsx and 16 other locations - About 30 mins to fix
scripts/apps/authoring-react/fields/date/config.tsx on lines 9..13
scripts/apps/authoring-react/fields/media/media-carousel/image.tsx on lines 24..28
scripts/apps/authoring-react/with-keybindings.tsx on lines 9..13
scripts/apps/desks/components/MarkBtn.tsx on lines 11..15
scripts/apps/search/components/SelectBox.tsx on lines 45..49
scripts/apps/search/components/SmoothLoader.tsx on lines 16..20
scripts/apps/search/components/SmoothLoaderOuter.tsx on lines 16..20
scripts/core/helpers/with-popover.tsx on lines 17..21
scripts/core/interactive-article-actions-panel/actions/send-correction-tab.tsx on lines 19..23
scripts/extensions/broadcasting/src/authoring-fields/subitems/subitems-view-edit.tsx on lines 29..33
scripts/extensions/sams/src/components/assets/assetTypeFilterButtons.tsx on lines 37..41
scripts/extensions/sams/src/components/sets/manageSetsModal.tsx on lines 54..58
scripts/extensions/sams/src/ui/grid/GridItem.tsx on lines 16..20
scripts/extensions/sams/src/ui/list/ListItem.tsx on lines 25..29
scripts/extensions/sams/src/ui/modal/Modal.tsx on lines 17..21
scripts/core/with-resources.tsx on lines 226..230

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

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

Avoid too many return statements within this function.
Open

        return 'top-start';
Severity: Major
Found in scripts/core/popper-utils.tsx - About 30 mins to fix

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

        constructor(props: IProps) {
            super(props);
    
            this.handleClicks = this.handleClicks.bind(this);
        }
    Severity: Major
    Found in scripts/extensions/sams/src/ui/grid/GridItem.tsx and 16 other locations - About 30 mins to fix
    scripts/apps/authoring-react/fields/date/config.tsx on lines 9..13
    scripts/apps/authoring-react/fields/media/media-carousel/image.tsx on lines 24..28
    scripts/apps/authoring-react/fields/urls/editor.tsx on lines 16..20
    scripts/apps/authoring-react/with-keybindings.tsx on lines 9..13
    scripts/apps/desks/components/MarkBtn.tsx on lines 11..15
    scripts/apps/search/components/SelectBox.tsx on lines 45..49
    scripts/apps/search/components/SmoothLoader.tsx on lines 16..20
    scripts/apps/search/components/SmoothLoaderOuter.tsx on lines 16..20
    scripts/core/helpers/with-popover.tsx on lines 17..21
    scripts/core/interactive-article-actions-panel/actions/send-correction-tab.tsx on lines 19..23
    scripts/extensions/broadcasting/src/authoring-fields/subitems/subitems-view-edit.tsx on lines 29..33
    scripts/extensions/sams/src/components/assets/assetTypeFilterButtons.tsx on lines 37..41
    scripts/extensions/sams/src/components/sets/manageSetsModal.tsx on lines 54..58
    scripts/extensions/sams/src/ui/list/ListItem.tsx on lines 25..29
    scripts/extensions/sams/src/ui/modal/Modal.tsx on lines 17..21
    scripts/core/with-resources.tsx on lines 226..230

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

    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

    Avoid too many return statements within this function.
    Open

            return 'top-end';
    Severity: Major
    Found in scripts/core/popper-utils.tsx - About 30 mins to fix

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

          constructor(props: IProps) {
              super(props);
      
              this.handleKeydown = this.handleKeydown.bind(this);
          }
      Severity: Major
      Found in scripts/extensions/sams/src/ui/modal/Modal.tsx and 16 other locations - About 30 mins to fix
      scripts/apps/authoring-react/fields/date/config.tsx on lines 9..13
      scripts/apps/authoring-react/fields/media/media-carousel/image.tsx on lines 24..28
      scripts/apps/authoring-react/fields/urls/editor.tsx on lines 16..20
      scripts/apps/authoring-react/with-keybindings.tsx on lines 9..13
      scripts/apps/desks/components/MarkBtn.tsx on lines 11..15
      scripts/apps/search/components/SelectBox.tsx on lines 45..49
      scripts/apps/search/components/SmoothLoader.tsx on lines 16..20
      scripts/apps/search/components/SmoothLoaderOuter.tsx on lines 16..20
      scripts/core/helpers/with-popover.tsx on lines 17..21
      scripts/core/interactive-article-actions-panel/actions/send-correction-tab.tsx on lines 19..23
      scripts/extensions/broadcasting/src/authoring-fields/subitems/subitems-view-edit.tsx on lines 29..33
      scripts/extensions/sams/src/components/assets/assetTypeFilterButtons.tsx on lines 37..41
      scripts/extensions/sams/src/components/sets/manageSetsModal.tsx on lines 54..58
      scripts/extensions/sams/src/ui/grid/GridItem.tsx on lines 16..20
      scripts/extensions/sams/src/ui/list/ListItem.tsx on lines 25..29
      scripts/core/with-resources.tsx on lines 226..230

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

      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 17 locations. Consider refactoring.
      Open

          constructor(props: ILiveResourcesProps) {
              super(props);
      
              this.setLoaded = this.setLoaded.bind(this);
          }
      Severity: Major
      Found in scripts/core/with-resources.tsx and 16 other locations - About 30 mins to fix
      scripts/apps/authoring-react/fields/date/config.tsx on lines 9..13
      scripts/apps/authoring-react/fields/media/media-carousel/image.tsx on lines 24..28
      scripts/apps/authoring-react/fields/urls/editor.tsx on lines 16..20
      scripts/apps/authoring-react/with-keybindings.tsx on lines 9..13
      scripts/apps/desks/components/MarkBtn.tsx on lines 11..15
      scripts/apps/search/components/SelectBox.tsx on lines 45..49
      scripts/apps/search/components/SmoothLoader.tsx on lines 16..20
      scripts/apps/search/components/SmoothLoaderOuter.tsx on lines 16..20
      scripts/core/helpers/with-popover.tsx on lines 17..21
      scripts/core/interactive-article-actions-panel/actions/send-correction-tab.tsx on lines 19..23
      scripts/extensions/broadcasting/src/authoring-fields/subitems/subitems-view-edit.tsx on lines 29..33
      scripts/extensions/sams/src/components/assets/assetTypeFilterButtons.tsx on lines 37..41
      scripts/extensions/sams/src/components/sets/manageSetsModal.tsx on lines 54..58
      scripts/extensions/sams/src/ui/grid/GridItem.tsx on lines 16..20
      scripts/extensions/sams/src/ui/list/ListItem.tsx on lines 25..29
      scripts/extensions/sams/src/ui/modal/Modal.tsx on lines 17..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 45.

      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

      Avoid too many return statements within this function.
      Open

          return placement;
      Severity: Major
      Found in scripts/core/popper-utils.tsx - About 30 mins to fix

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

                }, () => {
                    this.props.onChange(this.state.desks.map((d) => d._id));
                });
        scripts/extensions/sams/src/components/common/DesksSelectInput.tsx on lines 83..85

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

        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

                }, () => {
                    this.props.onChange(this.state.desks.map((d) => d._id));
                });
        scripts/extensions/sams/src/components/common/DesksSelectInput.tsx on lines 95..97

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

        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

                    if (_continue) {
                        el(['interactive-actions-panel', 'send-and-open']).click();
                    } else {
                        el(['interactive-actions-panel', 'send']).click();
                    }
        Severity: Minor
        Found in e2e/client/specs/helpers/authoring.ts and 1 other location - About 30 mins to fix
        e2e/client/specs/helpers/authoring.ts on lines 313..317

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

        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

                this.showSearch = function() {
                    el(['workspace-navigation'], by.css('[aria-label="Search"]')).click();
                };
        Severity: Minor
        Found in e2e/client/specs/helpers/monitoring.ts and 1 other location - About 30 mins to fix
        e2e/client/specs/helpers/monitoring.ts on lines 159..161

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

        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

                                <ListItemRow justifyContent="flex-end">
                                    <ListItemColumn>
                                        <VersionCreated item={article} />
                                    </ListItemColumn>
                                </ListItemRow>
        Severity: Minor
        Found in scripts/core/ui/components/article-item-concise.tsx and 1 other location - About 30 mins to fix
        scripts/core/ui/components/article-item-concise.tsx on lines 60..64

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

        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

                            scope.contentExpiry.days > 0 || scope.contentExpiry.hours > 0 ||
                            scope.contentExpiry.minutes > 0)) {
        Severity: Minor
        Found in scripts/apps/desks/directives/ContentExpiry.ts and 1 other location - About 30 mins to fix
        scripts/apps/authoring-react/fields/difference-statistics.ts on lines 73..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 45.

        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

                            $scope.fieldsNotSelected[field.id] = field.first_field_options.values.filter(
                                (fieldName) => !(fieldName in selectedFields),
                            );
        Severity: Minor
        Found in scripts/apps/ingest/directives/IngestSourcesContent.ts and 1 other location - About 30 mins to fix
        scripts/apps/ingest/directives/IngestSourcesContent.ts on lines 399..401

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

        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

                    _flags.marked_for_legal ?
                        React.createElement(
                            'span', {
                                className: 'state-label legal',
                                title: gettext('Legal'),
        Severity: Minor
        Found in scripts/apps/search/components/fields/flags.tsx and 1 other location - About 30 mins to fix
        scripts/apps/search/components/fields/flags.tsx on lines 11..18

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

        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

                        <div className="sd-page__header sd-page__header--white">
                            <h2 className="sd-page__page-heading">{this.props.title}</h2>
                        </div>
        Severity: Minor
        Found in scripts/apps/settings/settings-page.tsx and 1 other location - About 30 mins to fix
        scripts/apps/vocabularies/components/VocabularyItemsViewEdit.tsx on lines 532..534

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

        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

                const wrapper = mount(
                    <AuthoringCustomField
                        item={article}
                        field={vocabulary}
                        editable={true}
        scripts/apps/authoring/authoring/authoring-custom-field.spec.tsx on lines 113..120

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

        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

                                sdApi.vocabularies.getAll().toArray().map((item) => (
                                    <Option key={item._id} value={item._id}>{item.display_name}</Option>
                                ))
        Severity: Minor
        Found in scripts/apps/authoring-react/fields/editor3/config.tsx and 1 other location - About 30 mins to fix
        scripts/apps/authoring-react/article-widgets/metadata/metadata.tsx on lines 174..176

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

        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 class EditorVocabulary extends React.PureComponent<IProps> {
            render() {
                return (
                    <EditorUsingManualSourceOrVocabulary {...this.props} />
                );
        scripts/apps/authoring-react/fields/dropdown/dropdown-manual-entry/editor.tsx on lines 21..27

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

        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 class EditorManualEntry extends React.PureComponent<IProps> {
            render() {
                return (
                    <EditorUsingManualSourceOrVocabulary {...this.props} />
                );
        scripts/apps/authoring-react/fields/dropdown/dropdown-vocabulary/editor.tsx on lines 21..27

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

        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