superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

Function ItemActionsMenu has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

export function ItemActionsMenu(
    superdesk,
    activityService: IActivityService,
    workflowService,
    archiveService,
Severity: Minor
Found in scripts/apps/monitoring/directives/ItemActionsMenu.ts - About 2 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

Function handleKey has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    handleKey(event) {
        const {scope} = this.props;
        const {Keys} = this.props.svc;

        let diff;
Severity: Minor
Found in scripts/apps/contacts/components/ItemList.tsx - About 2 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

Function HighlightsService has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

export function HighlightsService(api, $q, $cacheFactory, packages: IPackagesService, privileges) {
    var service: any = {};
    var promise = {};
    var cache = $cacheFactory('highlightList');

Severity: Minor
Found in scripts/apps/highlights/services/HighlightsService.ts - About 2 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

Function MetaTagsDirective has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function MetaTagsDirective(api, $timeout) {
    var ENTER = 13;
    var ESC = 27;

    return {
Severity: Minor
Found in scripts/apps/authoring/metadata/metadata.ts - About 2 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

Function SearchMenuController has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

export default function SearchMenuController(
    $rootScope, $scope, $filter, $location, $route, searchProviderService, api, savedSearch,
    privileges,
) {
    let providerLabels = {};
Severity: Minor
Found in scripts/apps/search/controllers/SearchMenuController.ts - About 2 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

Function AuthoringWidgetsDir has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function AuthoringWidgetsDir(desks, commentsService, $injector) {
    return {
        controller: WidgetsManagerCtrl,
        templateUrl: 'scripts/apps/authoring/widgets/views/authoring-widgets.html',
        transclude: true,
Severity: Minor
Found in scripts/apps/authoring/widgets/widgets.ts - About 2 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

Function getLeftRangeAndTextForStyle has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function getLeftRangeAndTextForStyle(editorState, style) {
    const type = getHighlightTypeFromStyleName(style);
    const selection = editorState.getSelection();
    const content = editorState.getCurrentContent();
    let startBlock = content.getBlockForKey(selection.getStartKey());
Severity: Minor
Found in scripts/core/editor3/helpers/highlights.ts - About 2 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

Function processSuggestion has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

const processSuggestion = (state, {data, suggestion}, accepted) => {
    if (accepted === true || accepted === false) {
        // after clicking accept/reject editor focus is lost
        // restore the focus so undo stack is correct
        // and pop up can be positioned properly on undo SDFID-401
Severity: Minor
Found in scripts/core/editor3/reducers/suggestions.tsx - About 2 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

Function getSpellcheckingDecorator has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

export function getSpellcheckingDecorator(
    language: string,
    spellcheckWarnings: ISpellcheckWarningsByBlock,
    {disableContextMenu = false} = {},
) {

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 PublishQueueController.ts has 267 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import _ from 'lodash';
import {isSuperdeskContent} from 'apps/workspace/helpers/isSuperdeskContent';
import {gettext} from 'core/utils';

PublishQueueController.$inject = [
Severity: Minor
Found in scripts/apps/publish/controllers/PublishQueueController.ts - About 2 hrs to fix

    File RelatedItemsDirective.ts has 267 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import {gettext} from 'core/utils';
    import {AuthoringWorkspaceService} from 'apps/authoring/authoring/services/AuthoringWorkspaceService';
    import {IArticle, IVocabulary, IRendition} from 'superdesk-api';
    import {IDirectiveScope} from 'types/Angular/DirectiveScope';
    import {getAssociationsByFieldId} from '../../authoring/authoring/controllers/AssociationController';
    Severity: Minor
    Found in scripts/apps/relations/directives/RelatedItemsDirective.ts - About 2 hrs to fix

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

              link: function(scope, elem) {
                  scope.workspaceConfig = appConfig.workspace || {}; // it's used in workspaceMenu.filter
      
                  scope.badges = {};
      
      
      Severity: Major
      Found in scripts/apps/workspace/directives/WorkspaceSidenavDirective.ts - About 2 hrs to fix

        Function handleSave has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            handleSave() {
                const {gettext} = this.props.superdesk.localization;
                const {session, instance} = this.props.superdesk;
                const host = instance.config.server.url;
        
        
        Severity: Major
        Found in scripts/extensions/videoEditor/src/VideoEditorThumbnail.tsx - About 2 hrs to fix

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

              render() {
                  const {svc, contact, onCancel, hideActionBar, formClass} = this.props;
                  const {
                      isFormValid = false,
                      dirty = false,
          Severity: Major
          Found in scripts/apps/contacts/components/Form/ContactFormContainer.tsx - About 2 hrs to fix

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

                    link: function(scope) {
                        scope.$watch('step.current', (step, previous) => {
                            if (step === 'people') {
                                scope.search = null;
                                scope.deskMembers = [];
            Severity: Major
            Found in scripts/apps/desks/directives/DeskeditPeople.ts - About 2 hrs to fix

              Function save has 60 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  save() {
                      const {svc} = this.props;
                      const {notify, contacts} = svc;
              
                      const origContact = this.state.originalContact;
              Severity: Major
              Found in scripts/apps/contacts/components/Form/ContactFormContainer.tsx - About 2 hrs to fix

                Function resetUser has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            function resetUser() {
                                clearOrigUserWatcher();
                                clearUserWatcher();
                
                                scope.dirty = false;
                Severity: Major
                Found in scripts/apps/users/directives/UserEditDirective.ts - About 2 hrs to fix

                  Function MacrosReplaceDirective has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function MacrosReplaceDirective(editorResolver) {
                      return {
                          scope: true,
                          templateUrl: 'scripts/apps/authoring/macros/views/macros-replace.html',
                          link: function(scope) {
                  Severity: Major
                  Found in scripts/apps/authoring/macros/macros.ts - About 2 hrs to fix

                    Function RenditionsService has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function RenditionsService(metadata, $q, api, superdesk, _) {
                        var self = this;
                    
                        /**
                         *  ngdoc method
                    Severity: Major
                    Found in scripts/apps/authoring/authoring/services/RenditionsService.ts - About 2 hrs to fix

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

                          render() {
                              const {loading} = this.state;
                      
                              return (
                                  <div className="widget-container">
                        Severity
                        Category
                        Status
                        Source
                        Language