superdesk/superdesk-client-core

View on GitHub
scripts/apps/authoring-react/fields/media/media-carousel/image.tsx

Summary

Maintainability
C
7 hrs
Test Coverage

Function render has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        const {
            item,
            title,
            removeButton,
Severity: Major
Found in scripts/apps/authoring-react/fields/media/media-carousel/image.tsx - About 3 hrs to fix

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

                                                <IconButton
                                                    ariaValue={gettext('Edit image')}
                                                    icon="switches"
                                                    style="outlineWhite"
                                                    size="x-large"
    scripts/apps/authoring-react/fields/media/media-carousel/image.tsx on lines 77..85
    scripts/apps/authoring-react/fields/media/media-carousel/image.tsx on lines 97..105

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

    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

                                                <IconButton
                                                    ariaValue={gettext('Edit metadata')}
                                                    icon="pencil"
                                                    style="outlineWhite"
                                                    size="x-large"
    scripts/apps/authoring-react/fields/media/media-carousel/image.tsx on lines 87..95
    scripts/apps/authoring-react/fields/media/media-carousel/image.tsx on lines 97..105

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

    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

                                                <IconButton
                                                    ariaValue={gettext('Edit crops')}
                                                    icon="crop"
                                                    style="outlineWhite"
                                                    size="x-large"
    scripts/apps/authoring-react/fields/media/media-carousel/image.tsx on lines 77..85
    scripts/apps/authoring-react/fields/media/media-carousel/image.tsx on lines 87..95

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

    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: IProps) {
            super(props);
    
            this.edit = this.edit.bind(this);
        }
    scripts/apps/authoring-react/fields/date/config.tsx on lines 9..13
    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
    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

    There are no issues that match your filters.

    Category
    Status