superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

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

    onScroll(event: React.UIEvent<HTMLDivElement>) {
        const node = event.currentTarget;

        if (node != null &&
            this.state.nextPageLoading === false &&
scripts/extensions/sams/src/apps/samsWorkspace.tsx on lines 193..206

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

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

    onScroll(event: React.UIEvent<HTMLDivElement>) {
        const node = event.currentTarget;

        if (node != null &&
            this.state.nextPageLoading === false &&
Severity: Major
Found in scripts/extensions/sams/src/apps/samsWorkspace.tsx and 1 other location - About 7 hrs to fix
scripts/extensions/sams/src/components/assets/selectAssetModal.tsx on lines 111..124

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

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

    render() {
        const valueTypeText: IDropdownConfig['type'] = 'text';
        const valueTypeNumber: IDropdownConfig['type'] = 'number';

        const config: IDropdownConfig = this.getConfig();

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

                        <Spacer v gap="16">
                            {
                                commentsByField.map(({fieldId, comments}, i) => {
                                    return (
                                        <div key={i}>
    scripts/apps/authoring-react/article-widgets/suggestions.tsx on lines 181..206

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

    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

                        <Spacer v gap="16">
                            {
                                resolvedSuggestions.map(({fieldId, suggestions}, i) => {
                                    return (
                                        <div key={i}>
    Severity: Major
    Found in scripts/apps/authoring-react/article-widgets/suggestions.tsx and 1 other location - About 7 hrs to fix
    scripts/apps/authoring-react/generic-widgets/inline-comments.tsx on lines 184..209

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

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

    export function getContentProfileFormConfig(
        editor: IContentProfileEditorConfig,
        schema: any,
        customFields: Array<any>,
        field?: Partial<IContentProfileFieldWithSystemId> | undefined,

      Function SubscribersDirective has 177 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function SubscribersDirective(
          notify, api, subscribersService, adminPublishSettingsService,
          modal, contentFilters, $q, $filter, products, $rootScope,
      ) {
          return {
      Severity: Major
      Found in scripts/apps/publish/directives/SubscribersDirective.ts - About 7 hrs to fix

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

            render() {
                return (
                    <div
                        ref={(el) => {
                            this.wrapper = el;
        Severity: Major
        Found in scripts/core/ui/components/select2.tsx - About 7 hrs to fix

          File index.tsx has 460 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* eslint-disable indent */
          
          // styles
          import './styles/related-item.scss';
          import './styles/assignment.scss';
          Severity: Minor
          Found in scripts/apps/archive/index.tsx - About 7 hrs to fix

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

                render() {
                    const {currentPage} = this.state;
                    const {mediaItems, maxItemsAllowed, readOnly, showPictureCrops, showTitleInput} = this.props;
                    const onChange = this.props.onChange ?? noop;
            
            

              Function ContentService has 174 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function ContentService(api, templates, desks, packages: IPackagesService, archiveService, notify,
                  $filter, $q, $rootScope, session, renditions) {
                  const TEXT_TYPE = 'text';
              
                  const self = this;
              Severity: Major
              Found in scripts/apps/workspace/content/services/ContentService.ts - About 6 hrs to fix

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

                export class Preview extends React.PureComponent<IProps> {
                    render() {
                        if (this.props.value == null || this.props.value.length < 1) {
                            return null;
                        }
                scripts/apps/authoring-react/fields/linked-items/preview.tsx on lines 8..33

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

                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 Preview extends React.PureComponent<IProps> {
                    render() {
                        if (this.props.value == null || this.props.value.length < 1) {
                            return null;
                        }
                Severity: Major
                Found in scripts/apps/authoring-react/fields/linked-items/preview.tsx and 1 other location - About 6 hrs to fix
                scripts/apps/authoring-react/fields/package-items/preview.tsx on lines 8..33

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

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

                        link: function(scope: IScope, elem) {
                            let containerElem = elem.find('.sd-column-box__main-column');
                
                            scope.contentStyle = scope.contentStyle ?? {padding: '0 20px 20px'};
                
                
                Severity: Major
                Found in scripts/apps/monitoring/directives/MonitoringView.ts - About 6 hrs to fix

                  Function getNewItemComponent has 169 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function getNewItemComponent(superdesk: ISuperdesk): React.ComponentType<IProps> {
                      const {gettext} = superdesk.localization;
                  
                      const entityGroupsWithLabels = getGroups(superdesk).filter((_, id) => entityGroups.has(id));
                  
                  
                  Severity: Major
                  Found in scripts/extensions/auto-tagging-widget/src/new-item.tsx - About 6 hrs to fix

                    File authoring-integration-wrapper.tsx has 448 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /* eslint-disable react/no-multi-comp */
                    /* eslint-disable no-case-declarations */
                    import React from 'react';
                    import {Map} from 'immutable';
                    import {Button, ButtonGroup, NavButton} from 'superdesk-ui-framework/react';
                    Severity: Minor
                    Found in scripts/apps/authoring-react/authoring-integration-wrapper.tsx - About 6 hrs to fix

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

                                      <Row>
                                          <LineInput
                                              readOnly={readOnly}
                                              required={contactType === 'person'}
                                              invalid={contactType === 'person' && this.isFieldInvalid('last_name')}
                      Severity: Major
                      Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx and 1 other location - About 6 hrs to fix
                      scripts/apps/contacts/components/Form/ProfileDetail.tsx on lines 308..329

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

                      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

                                          <Row>
                                              <LineInput
                                                  readOnly={readOnly}
                                                  required={contactType === 'organisation'}
                                                  invalid={contactType === 'organisation' && this.isFieldInvalid('organisation')}
                      Severity: Major
                      Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx and 1 other location - About 6 hrs to fix
                      scripts/apps/contacts/components/Form/ProfileDetail.tsx on lines 287..305

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

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

                              link: function($scope) {
                                  $scope.subscriber = null;
                                  $scope.origSubscriber = null;
                                  $scope.subscribers = $scope.subscribersList || null;
                                  $scope.newDestination = null;
                      Severity: Major
                      Found in scripts/apps/publish/directives/SubscribersDirective.ts - About 6 hrs to fix

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

                            const getActionsBulk
                            : Array<IExtensionActivationResult['contributions']['entities']['article']['getActionsBulk']>
                            = flatMap(
                                Object.values(extensions).map(({activationResult}) => activationResult),
                                (activationResult) =>
                        Severity: Major
                        Found in scripts/apps/monitoring/MultiActionBarReact.tsx and 2 other locations - About 6 hrs to fix
                        scripts/apps/search/controllers/get-multi-actions.tsx on lines 171..182
                        scripts/apps/archive/index.tsx on lines 476..487

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

                        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