superdesk/superdesk-client-core

View on GitHub

Showing 1,922 of 3,654 total issues

Function AuthoringDirective has a Cognitive Complexity of 210 (exceeds 5 allowed). Consider refactoring.
Open

export function AuthoringDirective(
    superdesk,
    authoringWorkspace: AuthoringWorkspaceService,
    notify,
    desks,
Severity: Minor
Found in scripts/apps/authoring/authoring/directives/AuthoringDirective.ts - About 4 days 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

Function AuthoringDirective has 742 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function AuthoringDirective(
    superdesk,
    authoringWorkspace: AuthoringWorkspaceService,
    notify,
    desks,
Severity: Major
Found in scripts/apps/authoring/authoring/directives/AuthoringDirective.ts - About 3 days to fix

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

            link: function($scope, elem, attrs) {
                $scope.loading = false;
                $scope.tabsPinned = false;
    
                var _closing;
    Severity: Major
    Found in scripts/apps/authoring/authoring/directives/AuthoringDirective.ts - About 3 days to fix

      Function constructor has 667 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          constructor() {
              this.lock = element(by.css('[ng-click="lock()"]'));
              this.correct_button = element(by.buttonText('correct'));
              this.kill_button = element(by.buttonText('kill'));
              this.close_button = element(by.buttonText('Close'));
      Severity: Major
      Found in e2e/client/specs/helpers/authoring.ts - About 3 days to fix

        Function SearchService has a Cognitive Complexity of 155 (exceeds 5 allowed). Consider refactoring.
        Open

        export function SearchService($location, session, multi,
            preferencesService, moment, sortService) {
            const PARAMETERS = getParameters();
            const EXCLUDE_FACETS = getExcludeFacets();
        
        
        Severity: Minor
        Found in scripts/apps/search/services/SearchService.ts - About 3 days 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

        Function getInlineToolbarActions has 630 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function getInlineToolbarActions(
            options: IExposedFromAuthoring<IArticle>,
            action?: IAuthoringActionType,
        ): IAuthoringOptions<IArticle> {
            const {
        Severity: Major
        Found in scripts/apps/authoring-react/authoring-angular-integration.tsx - About 3 days to fix

          File authoring-react.tsx has 1195 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React from 'react';
          import {
              IArticle,
              IAuthoringFieldV2,
              IContentProfileV2,
          Severity: Major
          Found in scripts/apps/authoring-react/authoring-react.tsx - About 3 days to fix

            File metadata.ts has 1148 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import _ from 'lodash';
            import PreferedCvItemsConfigDirective from './PreferedCvItemsConfigDirective';
            import MetaPlaceDirective from './MetaPlaceDirective';
            import {getVocabularySelectionTypes} from '../../vocabularies/constants';
            import {gettext} from 'core/utils';
            Severity: Major
            Found in scripts/apps/authoring/metadata/metadata.ts - About 2 days to fix

              Function getAutoTaggingComponent has 572 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function getAutoTaggingComponent(superdesk: ISuperdesk, label: string) {
                  const {preferences} = superdesk;
                  const {httpRequestJsonLocal} = superdesk;
                  const {gettext, gettextPlural} = superdesk.localization;
                  const {memoize, generatePatch, arrayToTree} = superdesk.utilities;
              Severity: Major
              Found in scripts/extensions/auto-tagging-widget/src/auto-tagging.tsx - About 2 days to fix

                Function MonitoringGroup has a Cognitive Complexity of 139 (exceeds 5 allowed). Consider refactoring.
                Open

                export function MonitoringGroup(
                    cards,
                    api,
                    authoringWorkspace: AuthoringWorkspaceService,
                    $timeout,
                Severity: Minor
                Found in scripts/apps/monitoring/directives/MonitoringGroup.ts - About 2 days 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

                Function AuthoringService has 557 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function AuthoringService(
                    $q,
                    $location,
                    api,
                    lock,
                Severity: Major
                Found in scripts/apps/authoring/authoring/services/AuthoringService.ts - About 2 days to fix

                  Function constructor has 544 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      constructor() {
                          this.config = element(by.className('aggregate-settings'));
                          this.label = element(by.model('widget.configuration.label'));
                  
                          this.openMonitoring = function() {
                  Severity: Major
                  Found in e2e/client/specs/helpers/monitoring.ts - About 2 days to fix

                    Function IngestSourcesContent has 520 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function IngestSourcesContent(ingestSources, api, $location,
                        modal, $filter, privileges) {
                        return {
                            templateUrl: 'scripts/apps/ingest/views/settings/ingest-sources-content.html',
                            link: function($scope) {
                    Severity: Major
                    Found in scripts/apps/ingest/directives/IngestSourcesContent.ts - About 2 days to fix

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

                              link: function($scope) {
                                  $scope.waitForDirectiveReady = function() {
                                      return Promise.all([
                                          ingestSources.fetchAllFeedingServicesAllowed(),
                                      ]);
                      Severity: Major
                      Found in scripts/apps/ingest/directives/IngestSourcesContent.ts - About 2 days to fix

                        File ui.ts has 999 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /* eslint-disable max-len */
                        /* tslint:disable:max-line-length */
                        
                        import _, {difference, filter, mapValues, sortBy, union, without} from 'lodash';
                        import moment from 'moment-timezone';
                        Severity: Major
                        Found in scripts/core/ui/ui.ts - About 2 days to fix

                          File monitoring_spec.ts has 997 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /* eslint-disable newline-per-chained-call */
                          
                          import {element, browser, by, protractor, ElementFinder} from 'protractor';
                          
                          import {monitoring} from './helpers/monitoring';
                          Severity: Major
                          Found in e2e/client/specs/monitoring_spec.ts - About 2 days to fix

                            Function SearchService has 498 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function SearchService($location, session, multi,
                                preferencesService, moment, sortService) {
                                const PARAMETERS = getParameters();
                                const EXCLUDE_FACETS = getExcludeFacets();
                            
                            
                            Severity: Major
                            Found in scripts/apps/search/services/SearchService.ts - About 2 days to fix

                              Function MonitoringGroup has 483 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function MonitoringGroup(
                                  cards,
                                  api,
                                  authoringWorkspace: AuthoringWorkspaceService,
                                  $timeout,
                              Severity: Major
                              Found in scripts/apps/monitoring/directives/MonitoringGroup.ts - About 2 days to fix

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

                                    render() {
                                        const {historyItems} = this.state;
                                
                                        if (historyItems == null) {
                                            return null;

                                  Function AuthoringService has a Cognitive Complexity of 115 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export function AuthoringService(
                                      $q,
                                      $location,
                                      api,
                                      lock,
                                  Severity: Minor
                                  Found in scripts/apps/authoring/authoring/services/AuthoringService.ts - About 2 days 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