superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

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

    render() {
        const selectedIds = new Set(this.props.value.map(({qcode}) => qcode));
        const itemsExcludingSelected = this.props.vocabularies.filter(({qcode}) => selectedIds.has(qcode) !== true);

        return (

    Function link has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                    link: function(scope, elem, attrs) {
                        scope.item.actioning = {};
    
                        var intent: any = {
                            action: scope.action,
    Severity: Major
    Found in scripts/core/activity/activity-list-directive.ts - About 2 hrs to fix

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

          render() {
              const {suggestions, message} = this.props.warning;
              const {spellchecker} = this.props;
      
              // If the message exists, and suggestion is whitespace suggestion

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

                    return api('activity', {embedded: {user: 1}})
                        .save(_notification, {recipients: recipients})
                        .then(() => {
                            this.unread = _.max([0, this.unread - 1]);
                            notification._unread = null;
        Severity: Major
        Found in scripts/core/menu/notifications/notifications.ts and 1 other location - About 2 hrs to fix
        scripts/core/menu/notifications/notifications.ts on lines 90..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 89.

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

                this.eventListenersToRemoveBeforeUnmounting.push(
                    addWebsocketEventListener(
                        'resource:deleted',
                        (event: IWebsocketMessage<IResourceDeletedEvent>) => {
                            const {resource, _id} = event.extra;
        Severity: Major
        Found in scripts/core/itemList/items-list-limited.tsx and 5 other locations - About 2 hrs to fix
        scripts/apps/search/components/ItemListAngularWrapper.tsx on lines 213..222
        scripts/apps/search/components/ItemListAngularWrapper.tsx on lines 235..244
        scripts/core/itemList/items-list-limited.tsx on lines 86..95
        scripts/core/ArticlesListV2.tsx on lines 218..227
        scripts/core/ArticlesListV2.tsx on lines 240..249

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

        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

                    return api('activity', {embedded: {user: 1}})
                        .save(_notification, {recipients: recipients})
                        .then(() => {
                            this.unread = _.max([0, this.unread - 1]);
                            notification._unread = null;
        Severity: Major
        Found in scripts/core/menu/notifications/notifications.ts and 1 other location - About 2 hrs to fix
        scripts/core/menu/notifications/notifications.ts on lines 207..212

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

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

                this.eventListenersToRemoveBeforeUnmounting.push(
                    addWebsocketEventListener(
                        'resource:deleted',
                        (event: IWebsocketMessage<IResourceDeletedEvent>) => {
                            const {resource, _id} = event.extra;
        Severity: Major
        Found in scripts/core/ArticlesListV2.tsx and 5 other locations - About 2 hrs to fix
        scripts/apps/search/components/ItemListAngularWrapper.tsx on lines 213..222
        scripts/apps/search/components/ItemListAngularWrapper.tsx on lines 235..244
        scripts/core/itemList/items-list-limited.tsx on lines 86..95
        scripts/core/itemList/items-list-limited.tsx on lines 108..117
        scripts/core/ArticlesListV2.tsx on lines 218..227

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

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

                this.eventListenersToRemoveBeforeUnmounting.push(
                    addWebsocketEventListener(
                        'resource:deleted',
                        (event: IWebsocketMessage<IResourceDeletedEvent>) => {
                            const {resource, _id} = event.extra;
        Severity: Major
        Found in scripts/apps/search/components/ItemListAngularWrapper.tsx and 5 other locations - About 2 hrs to fix
        scripts/apps/search/components/ItemListAngularWrapper.tsx on lines 213..222
        scripts/core/itemList/items-list-limited.tsx on lines 86..95
        scripts/core/itemList/items-list-limited.tsx on lines 108..117
        scripts/core/ArticlesListV2.tsx on lines 218..227
        scripts/core/ArticlesListV2.tsx on lines 240..249

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

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

                this.eventListenersToRemoveBeforeUnmounting.push(
                    addWebsocketEventListener(
                        'resource:created',
                        (event: IWebsocketMessage<IResourceCreatedEvent>) => {
                            const {resource, _id} = event.extra;
        Severity: Major
        Found in scripts/core/itemList/items-list-limited.tsx and 5 other locations - About 2 hrs to fix
        scripts/apps/search/components/ItemListAngularWrapper.tsx on lines 213..222
        scripts/apps/search/components/ItemListAngularWrapper.tsx on lines 235..244
        scripts/core/itemList/items-list-limited.tsx on lines 108..117
        scripts/core/ArticlesListV2.tsx on lines 218..227
        scripts/core/ArticlesListV2.tsx on lines 240..249

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

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

                this.eventListenersToRemoveBeforeUnmounting.push(
                    addWebsocketEventListener(
                        'resource:created',
                        (event: IWebsocketMessage<IResourceCreatedEvent>) => {
                            const {resource, _id} = event.extra;
        Severity: Major
        Found in scripts/core/ArticlesListV2.tsx and 5 other locations - About 2 hrs to fix
        scripts/apps/search/components/ItemListAngularWrapper.tsx on lines 213..222
        scripts/apps/search/components/ItemListAngularWrapper.tsx on lines 235..244
        scripts/core/itemList/items-list-limited.tsx on lines 86..95
        scripts/core/itemList/items-list-limited.tsx on lines 108..117
        scripts/core/ArticlesListV2.tsx on lines 240..249

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

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

                this.eventListenersToRemoveBeforeUnmounting.push(
                    addWebsocketEventListener(
                        'resource:created',
                        (event: IWebsocketMessage<IResourceCreatedEvent>) => {
                            const {resource, _id} = event.extra;
        Severity: Major
        Found in scripts/apps/search/components/ItemListAngularWrapper.tsx and 5 other locations - About 2 hrs to fix
        scripts/apps/search/components/ItemListAngularWrapper.tsx on lines 235..244
        scripts/core/itemList/items-list-limited.tsx on lines 86..95
        scripts/core/itemList/items-list-limited.tsx on lines 108..117
        scripts/core/ArticlesListV2.tsx on lines 218..227
        scripts/core/ArticlesListV2.tsx on lines 240..249

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

        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>
                            <Checkbox
                                label={{text: gettext('Show crops for pictures')}}
                                checked={config.showPictureCrops ?? false}
                                onChange={(val) => {
        Severity: Major
        Found in scripts/apps/authoring-react/fields/media/config.tsx and 1 other location - About 2 hrs to fix
        scripts/apps/authoring-react/fields/media/config.tsx on lines 108..116

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

        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 addInternalEventListener<T extends keyof IInternalEvents>(
            eventName: T,
            handler: (event: CustomEvent<IInternalEvents[T]>) => void,
        ) {
            window.addEventListener(eventName, handler);
        Severity: Major
        Found in scripts/core/internal-events.ts and 1 other location - About 2 hrs to fix
        scripts/apps/authoring-react/authoring-react-editor-events.ts on lines 59..68

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

        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.eventListenersToRemoveBeforeUnmounting.push(
                    addEditorEventListener('find_and_replace__find_prev', (event) => {
                        const {editorId} = event.detail;
        
                        if (editorId !== this.props.editorId) {
        Severity: Major
        Found in scripts/apps/authoring-react/fields/editor3/editor.tsx and 1 other location - About 2 hrs to fix
        scripts/apps/authoring-react/fields/editor3/editor.tsx on lines 227..237

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

        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>
                            <Checkbox
                                label={{text: gettext('Single line')}}
                                checked={config?.singleLine ?? false}
                                onChange={(val) => {
        Severity: Major
        Found in scripts/apps/authoring-react/fields/editor3/config.tsx and 1 other location - About 2 hrs to fix
        scripts/apps/authoring-react/fields/editor3/config.tsx on lines 65..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 89.

        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.handleEdit = function($event) {
                        clearErrorMessages();
                        if (!_.isNil(scope.editStage.name)) {
                            scope._errorLimits = scope.editStage.name.length > scope.limits.stage ? true : null;
                        }
        Severity: Major
        Found in scripts/apps/desks/directives/DeskeditStages.ts and 1 other location - About 2 hrs to fix
        scripts/apps/highlights/controllers/HighlightsConfig.ts on lines 96..101

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

        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.handleEdit = function($event) {
                clearErrorMessages();
                if (!_.isNil($scope.configEdit.name)) {
                    $scope._errorLimits = $scope.configEdit.name.length > $scope.limits.highlight ? true : null;
                }
        Severity: Major
        Found in scripts/apps/highlights/controllers/HighlightsConfig.ts and 1 other location - About 2 hrs to fix
        scripts/apps/desks/directives/DeskeditStages.ts on lines 202..207

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

        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.getRow = (name) => this.list.filter((elem, index) =>
                    elem.element(by.binding('filter.name'))
                        .getText()
                        .then((text) => text.toUpperCase() === name.toUpperCase()),
                );
        Severity: Major
        Found in e2e/client/specs/helpers/content_filters.ts and 1 other location - About 2 hrs to fix
        e2e/client/specs/helpers/filter_conditions.ts on lines 41..45

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

        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 addEditorEventListener<T extends keyof IAuthoringReactEditorEvents>(
            eventName: T,
            handler: (event: CustomEvent<IAuthoringReactEditorEvents[T]>) => void,
        ) {
            window.addEventListener(eventName, handler);
        scripts/core/internal-events.ts on lines 27..36

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

        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>
                            <Checkbox
                                label={{text: gettext('Show input for editing title')}}
                                checked={config.showTitleEditingInput ?? false}
                                onChange={(val) => {
        Severity: Major
        Found in scripts/apps/authoring-react/fields/media/config.tsx and 1 other location - About 2 hrs to fix
        scripts/apps/authoring-react/fields/media/config.tsx on lines 46..54

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

        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