superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

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

    render() {
        const {showId, rundownTitle, template} = this.state;

        return (
            <WithValidation dynamic validators={rundownValidators}>

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

        render() {
            const {gettext} = superdeskApi.localization;
            const {config} = superdeskApi.instance;
            const {numberToString} = superdeskApi.helpers;
            const sizeOptions = this.getSizeOptions();
    Severity: Major
    Found in scripts/extensions/sams/src/components/assets/assetFilterPanel.tsx - About 6 hrs to fix

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

          render(): React.ReactNode {
              let classes = 'proofreading-panel-content__text-field';
              let headlineClasses = `${classes} proofreading-panel-content__text-field--headline`;
              let bodyClasses = `${classes} proofreading-panel-content__text-field--body`;
              let abstractClasses = `${classes} proofreading-panel-content__text-field--abstract`;
      Severity: Major
      Found in scripts/apps/authoring-react/toolbar/proofreading-theme-panel.tsx - About 6 hrs to fix

        File Item.tsx has 431 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* eslint-disable react/no-multi-comp */
        
        import React from 'react';
        import classNames from 'classnames';
        import {get} from 'lodash';
        Severity: Minor
        Found in scripts/apps/search/components/Item.tsx - About 6 hrs to fix

          Function RelatedItemController has 158 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function RelatedItemController(
              $scope,
              api,
              BaseWidgetController,
              notify,
          Severity: Major
          Found in scripts/apps/archive/related-item-widget/relatedItem.ts - About 6 hrs to fix

            File index.ts has 429 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import 'libs/angular-history/history';
            
            import * as svc from './services';
            import * as directive from './directives';
            import * as ctrl from './controllers';
            Severity: Minor
            Found in scripts/apps/authoring/authoring/index.ts - About 6 hrs to fix

              File directive.tsx has 429 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /* eslint-disable react/no-multi-comp */
              /* eslint-disable complexity */
              import React from 'react';
              import ReactDOM from 'react-dom';
              import {Provider} from 'react-redux';
              Severity: Minor
              Found in scripts/core/editor3/directive.tsx - About 6 hrs to fix

                File SearchResults.ts has 427 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import _, {debounce, noop} from 'lodash';
                import {gettext} from 'core/utils';
                import {appConfig} from 'appConfig';
                import {ISearchOptions, showRefresh} from '../services/SearchService';
                import {IPackagesService} from 'types/Services/Packages';
                Severity: Minor
                Found in scripts/apps/search/directives/SearchResults.ts - About 6 hrs to fix

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

                          if (itemOpen === true) {
                              showOptionsModal(
                                  gettext('Save changes?'),
                                  gettext('There are some unsaved changes, save it now?'),
                                  [
                  Severity: Major
                  Found in scripts/core/ui/components/prompt-for-unsaved-changes.tsx and 1 other location - About 6 hrs to fix
                  scripts/core/ui/components/prompt-for-unsaved-changes.tsx on lines 67..103

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

                  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

                          } else {
                              showOptionsModal(
                                  gettext('Save changes?'),
                                  gettext('There are some unsaved changes, go to the article to save changes?'),
                                  [
                  Severity: Major
                  Found in scripts/core/ui/components/prompt-for-unsaved-changes.tsx and 1 other location - About 6 hrs to fix
                  scripts/core/ui/components/prompt-for-unsaved-changes.tsx on lines 31..67

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

                  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

                  File ChangeImageController.ts has 423 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import {get} from 'lodash';
                  import {gettext} from 'core/utils';
                  import {appConfig} from 'appConfig';
                  import {getLabelNameResolver} from 'apps/workspace/helpers/getLabelForFieldId';
                  
                  
                  Severity: Minor
                  Found in scripts/apps/authoring/authoring/controllers/ChangeImageController.ts - About 6 hrs to fix

                    File workspaceSubnav.tsx has 422 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    // External Modules
                    import * as React from 'react';
                    import {Dispatch} from 'redux';
                    import {connect} from 'react-redux';
                    
                    
                    Severity: Minor
                    Found in scripts/extensions/sams/src/components/workspaceSubnav.tsx - About 6 hrs to fix

                      Function MetadataCtrl has 153 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function MetadataCtrl(
                          $scope, desks, metadata, privileges, datetimeHelper, userList,
                          preferencesService, archiveService, moment, content) {
                          desks.initialize();
                      
                      
                      Severity: Major
                      Found in scripts/apps/authoring/metadata/metadata.ts - About 6 hrs to fix

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

                                    scope.remove = function(role) {
                                        confirm().then(() => {
                                            api('roles').remove(role)
                                                .then((result) => {
                                                    _.remove(scope.roles, role);
                        Severity: Major
                        Found in scripts/apps/users/directives/UserRolesDirective.ts and 1 other location - About 6 hrs to fix
                        scripts/apps/ingest/directives/IngestRulesContent.ts on lines 45..58

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

                        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.remove = function(filterCondition) {
                                    modal.confirm(gettext('Are you sure you want to delete filter condition?'))
                                        .then(() => contentFilters.remove(filterCondition))
                                        .then((result) => {
                                            _.remove($scope.filterConditions, filterCondition);
                        scripts/apps/content-filters/controllers/ManageContentFiltersController.ts on lines 83..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 157.

                        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.remove = function(ruleset) {
                                        confirm().then(() => {
                                            api('rule_sets').remove(ruleset)
                                                .then((result) => {
                                                    _.remove(scope.rulesets, ruleset);
                        Severity: Major
                        Found in scripts/apps/ingest/directives/IngestRulesContent.ts and 1 other location - About 6 hrs to fix
                        scripts/apps/users/directives/UserRolesDirective.ts on lines 59..72

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

                        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.remove = function(pf) {
                                    modal.confirm(gettext('Are you sure you want to delete content filter?'))
                                        .then(() => contentFilters.remove(pf))
                                        .then((result) => {
                                            _.remove($scope.contentFilters, pf);
                        scripts/apps/content-filters/controllers/FilterConditionsController.ts on lines 119..131

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

                        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

                            constructor(props) {
                                super(props);
                                this.state = {
                                    openDatePicker: false,
                                    invalid: false,
                        Severity: Major
                        Found in scripts/core/ui/components/Form/DateInput/index.tsx and 1 other location - About 6 hrs to fix
                        scripts/core/ui/components/Form/TimeInput/index.tsx on lines 23..37

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

                        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

                            constructor(props) {
                                super(props);
                                this.state = {
                                    openTimePicker: false,
                                    invalid: false,
                        Severity: Major
                        Found in scripts/core/ui/components/Form/TimeInput/index.tsx and 1 other location - About 6 hrs to fix
                        scripts/core/ui/components/Form/DateInput/index.tsx on lines 24..38

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

                        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 ItemCarouselDirective has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export function ItemCarouselDirective(notify, relationsService) {
                            return {
                                scope: {
                                    allowAudio: '<',
                                    allowPicture: '<',
                        Severity: Minor
                        Found in scripts/apps/authoring/authoring/directives/ItemCarouselDirective.ts - About 6 hrs to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Severity
                        Category
                        Status
                        Source
                        Language