superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

Function DeskNotifications has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function DeskNotifications(desks, deskNotifications, authoringWorkspace: AuthoringWorkspaceService, $timeout) {
    return {
        scope: {stage: '=stage'},
        templateUrl: 'scripts/apps/monitoring/views/desk-notifications.html',
        link: function(scope) {
Severity: Minor
Found in scripts/apps/monitoring/directives/DeskNotifications.ts - About 1 hr to fix

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

        render() {
            const {
                item,
                title,
                removeButton,
    Severity: Minor
    Found in scripts/apps/authoring-react/fields/media/media-carousel/video.tsx - About 1 hr to fix

      Function handleKey has 48 lines of code (exceeds 25 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 1 hr to fix

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

                link: function(scope) {
                    init();
        
                    scope.$watch('item.lock_session', () => {
                        init();
        Severity: Minor
        Found in scripts/apps/archive/directives/ItemLock.ts - About 1 hr to fix

          Function updateItemAssociation has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              updateItemAssociation(scope, updated, customRel, callback = null, autosave = false): Promise<boolean> {
                  let data = {};
                  // if the media is of type media-gallery, update same association-key not the next one
                  // as the scope.rel contains the next association-key of the new item
                  let associationKey = scope.carouselItem ? scope.carouselItem.fieldId : customRel || scope.rel;

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

                    link: function(scope: IScope) {
                        scope.closeModal = () => {
                            scope.cancelEditingSubscription();
                        };
            
            
            Severity: Minor
            Found in scripts/apps/search/directives/SavedSearchEditOwnSubscription.ts - About 1 hr to fix

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

                  render() {
                      const {
                          field,
                          label,
                          placeholder,
              Severity: Minor
              Found in scripts/core/ui/components/Form/DateInput/index.tsx - About 1 hr to fix

                Function TimezoneDirective has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function TimezoneDirective(tzdata, $timeout) {
                    return {
                        templateUrl: 'scripts/core/ui/views/sd-timezone.html',
                        scope: {
                            timezone: '=',
                Severity: Minor
                Found in scripts/core/ui/ui.ts - About 1 hr to fix

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

                      render() {
                          return (
                              <div
                                  style={{
                                      display: 'flex',
                  Severity: Minor
                  Found in scripts/core/editor3/components/media/dragable-editor3-block.tsx - About 1 hr to fix

                    Function focusFirstChildInput has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function focusFirstChildInput(parent: HTMLElement) {
                        const loadingStartTimestamp = Date.now();
                        let lastElementCount = null;
                    
                        /**
                    Severity: Minor
                    Found in scripts/utils/focus-first-child-input.ts - About 1 hr 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 getDifferenceStatistics has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function getDifferenceStatistics<T>(
                        items1: Array<T>,
                        items2: Array<T>,
                        getId: (item: T) => string,
                        isEqual: (item1: T, item2: T) => boolean,
                    Severity: Minor
                    Found in scripts/apps/authoring-react/fields/difference-statistics.ts - About 1 hr 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 handleDragDrop has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private handleDragDrop(event): void {
                            const superdeskType = getSuperdeskType(event);
                            const {config} = this.props;
                    
                            if (superdeskType == null) {
                    Severity: Minor
                    Found in scripts/apps/authoring-react/fields/media/editor.tsx - About 1 hr 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 ProductionTestController has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function ProductionTestController($scope, contentFilters, notify, $location, $window) {
                        $scope.preview = null;
                        $scope.selected = {};
                        $scope.selectedItem = {};
                        $scope.selectedfilter = null;

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

                        init(props) {
                            let value;
                            let title;
                            let altTitle;
                            let item;
                    Severity: Minor
                    Found in scripts/apps/contacts/components/ItemContainer.tsx - About 1 hr 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 ItemRendition has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function ItemRendition() {
                        return {
                            templateUrl: 'scripts/apps/archive/views/item-rendition.html',
                            scope: {
                                item: '=',
                    Severity: Minor
                    Found in scripts/apps/archive/directives/ItemRendition.ts - About 1 hr 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 HighlightsConfig has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function HighlightsConfig($scope, highlightsService, desks, api, notify, modal) {
                        highlightsService.get().then((items) => {
                            items._items = _.sortBy(items._items, (i) => i.name.toLowerCase());
                            $scope.configurations = items;
                        });
                    Severity: Minor
                    Found in scripts/apps/highlights/controllers/HighlightsConfig.ts - About 1 hr 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 updateItemAssociation has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                        updateItemAssociation(scope, updated, customRel, callback = null, autosave = false): Promise<boolean> {
                            let data = {};
                            // if the media is of type media-gallery, update same association-key not the next one
                            // as the scope.rel contains the next association-key of the new item
                            let associationKey = scope.carouselItem ? scope.carouselItem.fieldId : customRel || scope.rel;

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

                    function MultieditService(storage, superdesk, authoringWorkspace: AuthoringWorkspaceService, referrer, $location) {
                        // 1. Service manages multiedit screen
                        // 2. Screen has it's boards, at least 2 of them
                        // 3. Every board can be popuplated with one content item
                    
                    
                    Severity: Minor
                    Found in scripts/apps/authoring/multiedit/multiedit.ts - About 1 hr 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 ItemGlobalSearch has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function ItemGlobalSearch(
                        session, api, notify, keyboardManager, asset, authoringWorkspace: AuthoringWorkspaceService, authoring,
                    ) {
                        return {
                            scope: {repo: '=', context: '='},
                    Severity: Minor
                    Found in scripts/apps/search/directives/ItemGlobalSearch.ts - About 1 hr 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 getSelectSingleValueAutoComplete has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function getSelectSingleValueAutoComplete(
                        options: {
                            query: (searchString: string, props: IProps) => Promise<IRestApiResponse<any>>;
                            queryById: (id: string) => Promise<any>;
                            getPlaceholder: (props: IProps) => string;

                    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