superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

Function TasksController has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

function TasksController($scope, $timeout, api, notify, desks, tasks, $filter, archiveService) {
Severity: Major
Found in scripts/apps/dashboard/workspace-tasks/tasks.ts - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

            if (widget) {
                var locked = lock.isLocked($scope.item) && !lock.can_unlock($scope.item);
                var isReadOnlyStage = desks.isReadOnlyStage($scope.item.task.stage);
    
                return widget.needUnlock && (locked || isReadOnlyStage) ||
    Severity: Major
    Found in scripts/apps/authoring/widgets/widgets.ts - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

                      if (data && (data.item || data.items || data.item_id) && scope.showRefresh && !data.force) {
                          // if we know the ids of the items then try to fetch those only
                          originalQuery = angular.extend({}, criteria.source.query);
      
                          let items = data.items || {};
      Severity: Major
      Found in scripts/apps/search/directives/SearchResults.ts - About 1 hr to fix

        Function TagService has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        export function TagService($location, desks, userList, metadata, search,
            ingestSources, subscribersService, $q) {
        Severity: Major
        Found in scripts/apps/search/services/TagService.ts - About 1 hr to fix

          Function $get has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  function superdeskFactory($q, $rootScope, activityService, activityChooser, betaService,
                      features, privileges, $injector) {
          Severity: Major
          Found in scripts/core/activity/activity.ts - About 1 hr to fix

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

                  Watch.prototype.removeRevertHandler = function removeRevertHandler(name) {
                    if (!name) {
                      throw new Error('invalid parameters');
                    }
                    return this._removeHandler('$revert', name);
            Severity: Major
            Found in scripts/libs/angular-history/history.js and 3 other locations - About 1 hr to fix
            scripts/libs/angular-history/history.js on lines 305..310
            scripts/libs/angular-history/history.js on lines 321..326
            scripts/libs/angular-history/history.js on lines 353..359

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

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

                  Watch.prototype.removeChangeHandler = function removeChangeHandler(name) {
                    if (!name) {
                      throw new Error('invalid parameters');
                    }
                    return this._removeHandler('$change', name);
            Severity: Major
            Found in scripts/libs/angular-history/history.js and 3 other locations - About 1 hr to fix
            scripts/libs/angular-history/history.js on lines 289..294
            scripts/libs/angular-history/history.js on lines 321..326
            scripts/libs/angular-history/history.js on lines 353..359

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

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

                  Watch.prototype.removeRedoHandler =
                    function removeRedoHandler(name) {
                      if (!name) {
                        throw new Error('invalid parameters');
                      }
            Severity: Major
            Found in scripts/libs/angular-history/history.js and 3 other locations - About 1 hr to fix
            scripts/libs/angular-history/history.js on lines 289..294
            scripts/libs/angular-history/history.js on lines 305..310
            scripts/libs/angular-history/history.js on lines 321..326

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

            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

                            <Layout.PanelFooter>
                                <div style={{width: '100%', display: 'flex', flexDirection: 'column', gap: 8}}>
                                    {this.props.children}
                                </div>
                            </Layout.PanelFooter>
            scripts/core/interactive-article-actions-panel/panel/panel-footer.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 55.

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

                  Watch.prototype.removeUndoHandler = function removeUndoHandler(name) {
                    if (!name) {
                      throw new Error('invalid parameters');
                    }
                    return this._removeHandler('$undo', name);
            Severity: Major
            Found in scripts/libs/angular-history/history.js and 3 other locations - About 1 hr to fix
            scripts/libs/angular-history/history.js on lines 289..294
            scripts/libs/angular-history/history.js on lines 305..310
            scripts/libs/angular-history/history.js on lines 353..359

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

            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

                            <div className="side-panel__footer side-panel__footer--button-box-large">
                                <div style={{width: '100%', display: 'flex', flexDirection: 'column', gap: 8}}>
                                    {this.props.children}
                                </div>
                            </div>
            scripts/core/interactive-article-actions-panel/panel/panel-footer.tsx on lines 9..13

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

            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

                    const {label, value, labelKey, allowCustom, readOnly, invalid, required, onFocus, ...props} = this.props;
            Severity: Major
            Found in scripts/core/ui/components/Form/SelectTagInput/index.tsx and 2 other locations - About 1 hr to fix
            scripts/core/ui/components/Form/LinkInput.tsx on lines 104..104
            scripts/core/ui/components/Form/SelectMetaTermsInput/index.tsx on lines 80..80

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

            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

                    this.getItem = function(desk, stage, item) {
                        return this.getStage(desk, stage).all(by.className('content-item')).get(item);
                    };
            Severity: Major
            Found in e2e/client/specs/helpers/master_desks.ts and 2 other locations - About 1 hr to fix
            e2e/client/specs/helpers/master_desks.ts on lines 58..60
            e2e/client/specs/helpers/master_desks.ts on lines 66..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 55.

            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

                    this.getTask = function(desk, status, task) {
                        return this.getStatus(desk, status).all(by.repeater('item in items')).get(task);
                    };
            Severity: Major
            Found in e2e/client/specs/helpers/master_desks.ts and 2 other locations - About 1 hr to fix
            e2e/client/specs/helpers/master_desks.ts on lines 38..40
            e2e/client/specs/helpers/master_desks.ts on lines 66..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 55.

            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

                    const {value, label, labelKey, searchKey, valueKey, popupContainer, readOnly, onFocus, ...props} = this.props;
            scripts/core/ui/components/Form/LinkInput.tsx on lines 104..104
            scripts/core/ui/components/Form/SelectTagInput/index.tsx on lines 121..121

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

            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

                options: PropTypes.arrayOf(PropTypes.shape({
                    key: PropTypes.oneOfType([
                        PropTypes.string,
                        PropTypes.number,
                    ]),
            Severity: Major
            Found in scripts/core/ui/components/Form/Select.tsx and 1 other location - About 1 hr to fix
            scripts/apps/contacts/components/Form/Select.tsx on lines 36..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 55.

            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

                    this.getUser = function(desk, role, user) {
                        return this.getRole(desk, role).all(by.repeater('item in items')).get(user);
                    };
            Severity: Major
            Found in e2e/client/specs/helpers/master_desks.ts and 2 other locations - About 1 hr to fix
            e2e/client/specs/helpers/master_desks.ts on lines 38..40
            e2e/client/specs/helpers/master_desks.ts on lines 58..60

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

            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

                options: PropTypes.arrayOf(PropTypes.shape({
                    key: PropTypes.oneOfType([
                        PropTypes.string,
                        PropTypes.number,
                    ]),
            Severity: Major
            Found in scripts/apps/contacts/components/Form/Select.tsx and 1 other location - About 1 hr to fix
            scripts/core/ui/components/Form/Select.tsx on lines 43..49

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

            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

                    const {value, field, remove, onChange, label, readOnly, iframelyKey, onFocus, ...props} = this.props;
            Severity: Major
            Found in scripts/core/ui/components/Form/LinkInput.tsx and 2 other locations - About 1 hr to fix
            scripts/core/ui/components/Form/SelectMetaTermsInput/index.tsx on lines 80..80
            scripts/core/ui/components/Form/SelectTagInput/index.tsx on lines 121..121

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

            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

                    userList.getAll().then((users) => {
                        $scope.users = convertUsersArrayToObject(filterUsers(users, userIds));
                        $scope.items = _comments;
                    });
            Severity: Major
            Found in scripts/apps/authoring/track-changes/inline-comments.ts and 1 other location - About 1 hr to fix
            scripts/apps/authoring/track-changes/suggestions.ts on lines 72..76

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

            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