superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

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

export function getMultiActions(
    getSelectedItems: () => Array<IArticle>,
    unselectAll: () => void,
) {
    const $location = ng.get('$location');
Severity: Major
Found in scripts/apps/search/controllers/get-multi-actions.tsx - About 1 day to fix

    File rundown-view-edit.tsx has 681 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint-disable react/no-multi-comp */
    
    import * as React from 'react';
    import {
        IRundown,
    Severity: Major
    Found in scripts/extensions/broadcasting/src/rundowns/rundown-view-edit.tsx - About 1 day to fix

      File highlights.ts has 679 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import {RichUtils, EditorState} from 'draft-js';
      import {getHighlightsConfig} from '../highlightsConfig';
      import {editor3DataKeys, getCustomDataFromEditor, setCustomDataForEditor__deprecated} from './editor3CustomData';
      import {getDraftCharacterListForSelection} from './getDraftCharacterListForSelection';
      import {getDraftSelectionForEntireContent} from './getDraftSelectionForEntireContent';
      Severity: Major
      Found in scripts/core/editor3/helpers/highlights.ts - About 1 day to fix

        File monitoring.ts has 679 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* eslint-disable newline-per-chained-call */
        
        import {
            element, by, browser, protractor, ElementFinder, promise as wdpromise, ExpectedConditions as EC,
        } from 'protractor';
        Severity: Major
        Found in e2e/client/specs/helpers/monitoring.ts - About 1 day to fix

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

              render() {
                  return (
                      <Layout.AuthoringFrame
                          header={(
                              <SubNav>
          Severity: Major
          Found in scripts/apps/authoring-react/ui-framework-authoring-test.tsx - About 1 day to fix

            File VideoEditor.tsx has 666 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import * as React from 'react';
            // eslint-disable-next-line @typescript-eslint/ban-ts-comment
            // @ts-ignore
            import ReactCrop from 'react-image-crop';
            import 'react-image-crop/dist/ReactCrop.css';
            Severity: Major
            Found in scripts/extensions/videoEditor/src/VideoEditor.tsx - About 1 day to fix

              Function DesksFactory has 299 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function DesksFactory($q, api, preferencesService, userList, notify,
                  session, $filter, privileges, $rootScope) {
                  let _cache = {};
              
                  var _fetchAll = function(endpoint, parent?, page = 1, items = [], refresh = false) {
              Severity: Major
              Found in scripts/apps/desks/services/DesksFactory.ts - About 1 day to fix

                Function TemplatesDirective has 299 lines of code (exceeds 25 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: Major
                Found in scripts/apps/templates/directives/TemplatesDirective.ts - About 1 day to fix

                  Function MetaTermsDirective has 298 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function MetaTermsDirective(metadata, $filter, $timeout, preferencesService, desks) {
                      return {
                          scope: {
                              item: '=',
                              field: '@',
                  Severity: Major
                  Found in scripts/apps/authoring/metadata/metadata.ts - About 1 day to fix

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

                            link: function($scope) {
                                const TEMPLATEFILTERS = getTemplateFilters();
                    
                                $scope.weekdays = weekdays;
                                $scope.content_templates = null;
                    Severity: Major
                    Found in scripts/apps/templates/directives/TemplatesDirective.ts - About 1 day to fix

                      File AuthoringService.ts has 651 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import _, {cloneDeep} from 'lodash';
                      import {flatMap} from 'lodash';
                      import * as helpers from 'apps/authoring/authoring/helpers';
                      import {gettext} from 'core/utils';
                      import {logger} from 'core/services/logger';
                      Severity: Major
                      Found in scripts/apps/authoring/authoring/services/AuthoringService.ts - About 1 day to fix

                        Function UploadController has 290 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function UploadController(
                            $scope,
                            $q,
                            upload,
                            api,
                        Severity: Major
                        Found in scripts/apps/archive/controllers/UploadController.ts - About 1 day to fix

                          Function CardsService has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function CardsService(search, session, desks, $location) {
                              this.criteria = getCriteria;
                              this.shouldUpdate = shouldUpdate;
                          
                              function getCriteriaParams(card: ICard): IQueryParams {
                          Severity: Minor
                          Found in scripts/apps/monitoring/services/CardsService.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 getBulkActions has 274 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function getBulkActions(
                              articles: Array<IArticle>,
                              multiActions: IMultiActions,
                              getSelectedItems: () => Array<IArticle>,
                              unselectAll: () => void,
                          Severity: Major
                          Found in scripts/apps/search/controllers/get-bulk-actions.tsx - About 1 day to fix

                            Function initialize has 274 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                initialize($element, editor3, $scope, $rootScope) {
                                    if (this.item == null) {
                                        throw new Error(
                                            'Item must be provided in order to be able to save editor_state on it',
                                        );
                            Severity: Major
                            Found in scripts/core/editor3/directive.tsx - About 1 day to fix

                              Function MetaTermsDirectiveLink has 273 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      link: function MetaTermsDirectiveLink(scope, elem, attrs) {
                                          metadata.subjectScope = scope;
                                          scope.getLocaleName = metadata.getLocaleName;
                                          const reloadList = scope.reloadList === 'true';
                                          const includeParent = scope.includeParent === 'true';
                              Severity: Major
                              Found in scripts/apps/authoring/metadata/metadata.ts - About 1 day to fix

                                File ProfileDetail.tsx has 620 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import React from 'react';
                                import PropTypes from 'prop-types';
                                import classNames from 'classnames';
                                import {get, set, isEmpty, findKey, orderBy, map} from 'lodash';
                                
                                
                                Severity: Major
                                Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx - About 1 day to fix

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

                                      render() {
                                          const {template, showId} = this.state;
                                  
                                          const viewEditToolbar = template == null || template.type === 'create' ? null : (
                                              <WithLiveResources

                                    Function ChangeImageController has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    export function ChangeImageController($scope, notify, _, api, $rootScope, $q, content) {
                                        $scope.data = $scope.locals.data;
                                        $scope.data.cropData = {};
                                        $scope.validator = appConfig.validator_media_metadata;
                                        const sizes = {};
                                    Severity: Minor
                                    Found in scripts/apps/authoring/authoring/controllers/ChangeImageController.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 getSuperdeskApiImplementation has 263 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export function getSuperdeskApiImplementation(
                                        requestingExtensionId: string,
                                        extensions: IExtensions,
                                        modal,
                                        privileges,
                                    Severity: Major
                                    Found in scripts/core/get-superdesk-api-implementation.tsx - About 1 day to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language