superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

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

        link: function(scope, elem, attr, controller) {
            var containerElem = elem.find('.shadow-list-holder');
            var GRID_VIEW = 'mgrid',
                LIST_VIEW = 'compact';

Severity: Major
Found in scripts/apps/search/directives/SearchResults.ts - About 1 day to fix

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

        render() {
            const {additionalProps} = this.props;
    
            if (this.props.crudManager._items == null) {
                // loading
    Severity: Major
    Found in scripts/core/ui/components/ListPage/generic-list-page.tsx - About 1 day to fix

      Function MetaTermsDirective has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
      Open

      function MetaTermsDirective(metadata, $filter, $timeout, preferencesService, desks) {
          return {
              scope: {
                  item: '=',
                  field: '@',
      Severity: Minor
      Found in scripts/apps/authoring/metadata/metadata.ts - About 1 day 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 render has 362 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          render() {
              const {article} = this.props;
      
              const {
                  flags,
      Severity: Major
      Found in scripts/apps/authoring-react/article-widgets/metadata/metadata.tsx - About 1 day to fix

        Function AggregateCtrl has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
        Open

        export function AggregateCtrl($scope, desks, workspaces, preferencesService, storage,
            savedSearch, content) {
            const CONTENT_PROLFILE = gettext('Content profile');
            var PREFERENCES_KEY = 'agg:view';
            var defaultMaxItems = 10;
        Severity: Minor
        Found in scripts/apps/monitoring/controllers/AggregateCtrl.ts - About 1 day 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

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

        /* eslint-disable react/display-name */
        /* eslint-disable react/no-multi-comp */
        import {assertNever} from 'core/helpers/typescript-helpers';
        import {DeskAndStage} from './subcomponents/desk-and-stage';
        import {LockInfo} from './subcomponents/lock-info';
        Severity: Major
        Found in scripts/apps/authoring-react/authoring-angular-integration.tsx - About 1 day to fix

          Function SearchParameters has 353 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function SearchParameters($location, asset, tags, metadata, common, desks,
              userList, ingestSources, subscribersService, $templateCache, search) {
              return {
                  scope: {
                      repo: '=',
          Severity: Major
          Found in scripts/apps/search/directives/SearchParameters.ts - About 1 day to fix

            File generic-list-page.tsx has 742 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* eslint-disable react/no-multi-comp */
            /* eslint-disable brace-style */
            
            import React from 'react';
            import {noop} from 'lodash';
            Severity: Major
            Found in scripts/core/ui/components/ListPage/generic-list-page.tsx - About 1 day to fix

              Function WidgetGroup has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring.
              Open

              export function WidgetGroup(search, api, superdesk, desks, cards, $timeout, $q,
                  $location, $anchorScroll, activityService: IActivityService, $rootScope, datetime, metadata) {
                  const services = {
                      $anchorScroll: $anchorScroll,
                      $location: $location,
              Severity: Minor
              Found in scripts/apps/monitoring/directives/WidgetGroup.ts - About 1 day 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 link has 343 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      link: function(scope, elem) {
                          const PARAMETERS = getParameters();
                          var ENTER = 13;
              
                          scope.dateFilters = getDateFilters()
              Severity: Major
              Found in scripts/apps/search/directives/SearchParameters.ts - About 1 day to fix

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

                    render() {
                        const {templateFields, readOnly} = this.props;
                
                        const headline_template = this.props.templateFields.title_template ?? {
                            prefix: '',

                  Function WidgetGroup has 341 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function WidgetGroup(search, api, superdesk, desks, cards, $timeout, $q,
                      $location, $anchorScroll, activityService: IActivityService, $rootScope, datetime, metadata) {
                      const services = {
                          $anchorScroll: $anchorScroll,
                          $location: $location,
                  Severity: Major
                  Found in scripts/apps/monitoring/directives/WidgetGroup.ts - About 1 day to fix

                    File suggestions.tsx has 730 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import {EditorState, Modifier, RichUtils} from 'draft-js';
                    import {onChange} from './editor3';
                    import {acceptedInlineStyles, sanitizeContent} from '../helpers/inlineStyles';
                    import {
                        changeSuggestionsTypes, getStyleSuggestionsTypes,
                    Severity: Major
                    Found in scripts/core/editor3/reducers/suggestions.tsx - About 1 day to fix

                      File language-mapping-list.ts has 730 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /* jshint ignore:start */
                      // from github:mozilla/language-mapping-list
                      export default {
                          ach: {
                              nativeName: 'Lwo',
                      Severity: Major
                      Found in scripts/core/lang/language-mapping-list.ts - About 1 day to fix

                        Function ArticleEditDirective has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export function ArticleEditDirective(
                            autosave,
                            metadata,
                            $filter,
                            superdesk,
                        Severity: Minor
                        Found in scripts/apps/authoring/authoring/directives/ArticleEditDirective.ts - About 1 day 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 TemplatesDirective has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export function TemplatesDirective(notify, api, templates, modal, desks, weekdays, content, $filter, session, _) {
                            return {
                                templateUrl: 'scripts/apps/templates/views/templates.html',
                                link: function($scope) {
                                    const TEMPLATEFILTERS = getTemplateFilters();
                        Severity: Minor
                        Found in scripts/apps/templates/directives/TemplatesDirective.ts - About 1 day 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 render has 328 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            render() {
                                const state = this.state;
                                const {authoringStorage, fieldsAdapter, storageAdapter, getLanguage, getSidePanel} = this.props;
                        
                                if (state.initialized !== true) {
                        Severity: Major
                        Found in scripts/apps/authoring-react/authoring-react.tsx - About 1 day to fix

                          Function TagService has 327 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function TagService($location, desks, userList, metadata, search,
                              ingestSources, subscribersService, $q) {
                              const PARAMETERS = getParameters();
                              const EXCLUDE_FACETS = getExcludeFacets();
                              var tags: any = {};
                          Severity: Major
                          Found in scripts/apps/search/services/TagService.ts - About 1 day to fix

                            File auto-tagging.tsx has 697 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import * as React from 'react';
                            import {OrderedMap, OrderedSet, Map} from 'immutable';
                            import {Switch, Button, ButtonGroup, EmptyState, Autocomplete, Modal} from 'superdesk-ui-framework/react';
                            import {ToggleBoxNext} from 'superdesk-ui-framework';
                            import {showModal} from '@superdesk/common';
                            Severity: Major
                            Found in scripts/extensions/auto-tagging-widget/src/auto-tagging.tsx - About 1 day to fix

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

                                      link: function(scope, elem) {
                                          var criteria;
                              
                                          scope.page = 1;
                                          scope.fetching = false;
                              Severity: Major
                              Found in scripts/apps/monitoring/directives/WidgetGroup.ts - About 1 day to fix
                                Severity
                                Category
                                Status
                                Source
                                Language