superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

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

    render() {
        const {queueItems} = this.state;

        if (queueItems == null) {
            return null;

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

    export class LeftPanel extends React.PureComponent<IProps> {
        render() {
            const classes = classNames(
                'sd-main-content-grid__filter',
                {
    Severity: Major
    Found in scripts/extensions/sams/src/ui/LeftPanel.tsx and 2 other locations - About 2 hrs to fix
    scripts/extensions/sams/src/ui/ContentBar.tsx on lines 9..22
    scripts/extensions/sams/src/ui/modal/ModalHeading.tsx on lines 9..24

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

    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

        return Object.freeze({
            notdesk: gettext('Not Desk'),
            nottype: gettext('Not Type'),
            notgenre: gettext('Not Genre'),
            notcategory: gettext('Not Category'),
    Severity: Major
    Found in scripts/apps/search/constants.ts and 1 other location - About 2 hrs to fix
    scripts/apps/contacts/constants.ts on lines 67..78

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

    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

    export class ContentBar extends React.PureComponent<IProps> {
        render() {
            const classes = classNames(
                'subnav__content-bar',
                {'subnav__content-bar--right': this.props.right === true},
    Severity: Major
    Found in scripts/extensions/sams/src/ui/ContentBar.tsx and 2 other locations - About 2 hrs to fix
    scripts/extensions/sams/src/ui/LeftPanel.tsx on lines 9..24
    scripts/extensions/sams/src/ui/modal/ModalHeading.tsx on lines 9..24

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

    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

    export class ModalHeading extends React.PureComponent<IProps> {
        render() {
            const classes = classNames(
                'modal__heading',
                {
    Severity: Major
    Found in scripts/extensions/sams/src/ui/modal/ModalHeading.tsx and 2 other locations - About 2 hrs to fix
    scripts/extensions/sams/src/ui/ContentBar.tsx on lines 9..22
    scripts/extensions/sams/src/ui/LeftPanel.tsx on lines 9..24

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

    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

        return {
            first_name: gettext('First Name'),
            last_name: gettext('Last Name'),
            contact_email: gettext('Email'),
            organisation: gettext('organisation'),
    Severity: Major
    Found in scripts/apps/contacts/constants.ts and 1 other location - About 2 hrs to fix
    scripts/apps/search/constants.ts on lines 31..42

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

    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 (e.keyCode === Keys.down) {
                            e.preventDefault();
                            e.stopPropagation();
                            if (list && list.children.length) {
                                scope.$applyAsync(() => {
    Severity: Major
    Found in scripts/core/directives/TypeaheadDirective.ts and 1 other location - About 2 hrs to fix
    scripts/core/directives/TypeaheadDirective.ts on lines 170..179

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

    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 (e.keyCode === Keys.up) {
                            e.preventDefault();
                            e.stopPropagation();
                            if (list && list.children.length) {
                                scope.$applyAsync(() => {
    Severity: Major
    Found in scripts/core/directives/TypeaheadDirective.ts and 1 other location - About 2 hrs to fix
    scripts/core/directives/TypeaheadDirective.ts on lines 159..168

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

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

        render() {
            const {config} = this.props;
            const Container = this.props.container;
            const values: Array<string> | Array<number> = (() => {
                if (this.props.value == null) {

      File multiedit.ts has 285 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * This file is part of Superdesk.
       *
       * Copyright 2015 Sourcefabric z.u. and contributors.
       *
      Severity: Minor
      Found in scripts/apps/authoring/multiedit/multiedit.ts - About 2 hrs to fix

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

                link: function(scope, _elem) {
                    scope.edit = null;
                    scope.activateSearchPane = false;
        
                    scope.$on('edit:search', (_event, args) => {
        Severity: Major
        Found in scripts/apps/search/directives/SaveSearch.ts - About 2 hrs to fix

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

              render() {
                  return (
                      <Popup
                          close={this.props.close}
                          target={this.props.target}
          Severity: Major
          Found in scripts/core/ui/components/Form/TimeInput/TimeInputPopup.tsx - About 2 hrs to fix

            Function applyChangeSuggestion has 71 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const applyChangeSuggestion = (editorState, accepted) => {
                const suggestionTypes = [...changeSuggestionsTypes, ...paragraphSuggestionTypes];
                let selection = editorState.getSelection();
                let content = editorState.getCurrentContent();
                let lastBlock = content.getBlockForKey(selection.getEndKey());
            Severity: Major
            Found in scripts/core/editor3/reducers/suggestions.tsx - About 2 hrs to fix

              Function publishItem_legacy has 70 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function publishItem_legacy(
                  orig: IArticle,
                  item: IArticle,
                  scope: IScope,
                  action: IAuthoringActionType = 'publish',
              Severity: Major
              Found in scripts/api/article.ts - About 2 hrs to fix

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

                        link: function(scope, elem) {
                            elem.attr('tabindex', 0);
                            let scrollElem = elem.parent();
                
                            var itemList = React.createElement(ItemListComponent,
                Severity: Major
                Found in scripts/apps/contacts/directives/ContactList.ts - About 2 hrs to fix

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

                          render() {
                              if (invalidFiles.length > 0) {
                                  return (
                                      <Modal
                                          visible
                  Severity: Major
                  Found in scripts/apps/archive/controllers/file-upload-error-modal.tsx - About 2 hrs to fix

                    Function showSpikeDialog has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function showSpikeDialog<T>(
                        modal: any,
                        doSpike: () => void,
                        promptForConfirmationMessage: string,
                        middlewares: Array<(value: T) => Promise<onSpikeMiddlewareResult>>,
                    Severity: Major
                    Found in scripts/apps/archive/show-spike-dialog.tsx - About 2 hrs to fix

                      Function UserPopupService has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function UserPopupService($compile, $timeout, userList) {
                          var popover: any = {};
                          var holdInterval = 300;
                      
                          // Create element
                      Severity: Major
                      Found in scripts/apps/users/services/UserPopupService.ts - About 2 hrs to fix

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

                                link: function(scope, elem) {
                                    scope.users = [];
                                    scope.fetching = false;
                                    scope.prefix = '';
                                    var fetchedPages = [];
                        Severity: Major
                        Found in scripts/apps/users/directives/UserMentionDirective.ts - About 2 hrs to fix

                          Function MetaDropdownDirective has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function MetaDropdownDirective($filter, metadata) {
                              return {
                                  scope: {
                                      list: '=',
                                      disabled: '=ngDisabled',
                          Severity: Major
                          Found in scripts/apps/authoring/metadata/metadata.ts - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language