superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

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

    render() {
        return (
            <WithAttachments item={this.props.item}>
                {(allAttachments) => {
                    if (allAttachments.length === 0) {
Severity: Minor
Found in scripts/core/editor3/components/links/AttachmentList.tsx - About 1 hr to fix

    Function replaceHighlight has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const replaceHighlight = (state, txt, all = false) => {
        const {index, pattern, caseSensitive, diff} = state.searchTerm;
        const es = state.editorState;
    
        let contentChanged = false;
    Severity: Minor
    Found in scripts/core/editor3/reducers/find-replace.tsx - About 1 hr to fix

      Function component has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          component() {
              let highlightsAndSuggestions = [];
              let data;
      
              if (this.styleBasedHighlightsExist()) {
      Severity: Minor
      Found in scripts/core/editor3/components/HighlightsPopup.tsx - About 1 hr to fix

        Function addDeleteParagraphSuggestions has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const addDeleteParagraphSuggestions = (editorState, data) => {
            const selection = editorState.getSelection();
            let newEditorState = editorState;
            let content = editorState.getCurrentContent();
            let block = content.getBlockForKey(selection.getStartKey());
        Severity: Minor
        Found in scripts/core/editor3/reducers/suggestions.tsx - About 1 hr to fix

          Function onload has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                                  img.onload = function() {
                                      if (!src || scope.showMinSizeError
                                      && !validateConstraints(scope.original, scope.rendition)) {
                                          return;
                                      }
          Severity: Minor
          Found in scripts/core/upload/image-crop-directive.ts - About 1 hr to fix

            Function getPublishToolbarWidget has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            function getPublishToolbarWidget(
                panelState: IStateInteractiveActionsPanelHOC,
                panelActions: IActionsInteractiveActionsPanelHOC,
            ): ITopBarWidget<IArticle> {
                const publishWidgetButton: ITopBarWidget<IArticle> = {
            Severity: Minor
            Found in scripts/apps/authoring-react/authoring-angular-integration.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 render has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                render() {
                    const sourceManualEntry: IDropdownConfig['source'] = 'manual-entry';
                    const sourceVocabulary: IDropdownConfig['source'] = 'vocabulary';
            
                    const config = (() => {
            Severity: Minor
            Found in scripts/apps/authoring-react/fields/dropdown/config-main.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 getArticleAdapter has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            export function getArticleAdapter(): IAuthoringReactArticleAdapter {
                const customFieldVocabularies = getCustomFieldVocabularies();
            
                const oldFormatCustomFieldIds: Set<IOldCustomFieldId> = new Set(
                    customFieldVocabularies
            Severity: Minor
            Found in scripts/apps/authoring-react/article-adapter.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 getFieldsAdapter has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            export function getFieldsAdapter(authoringStorage: IAuthoringStorage<IArticle>): IFieldsAdapter<IArticle> {
                const customFieldVocabularies = getCustomFieldVocabularies();
                const adapter: IFieldsAdapter<IArticle> = getBaseFieldsAdapter();
            
                for (const vocabulary of customFieldVocabularies) {
            Severity: Minor
            Found in scripts/apps/authoring-react/field-adapters/index.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 DeskeditPeople has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            export function DeskeditPeople(WizardHandler, desks, notify) {
                return {
                    link: function(scope) {
                        scope.$watch('step.current', (step, previous) => {
                            if (step === 'people') {
            Severity: Minor
            Found in scripts/apps/desks/directives/DeskeditPeople.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 IngestRoutingSchedule has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            export function IngestRoutingSchedule(tzdata) {
                return {
                    scope: {
                        rule: '=', // the routing rule whose schedule is being edited
                    },
            Severity: Minor
            Found in scripts/apps/ingest/directives/IngestRoutingSchedule.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 ItemLock has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            export function ItemLock(api, lock, privileges, desks) {
                return {
                    templateUrl: 'scripts/apps/archive/views/item-lock.html',
                    scope: {item: '='},
                    link: function(scope) {
            Severity: Minor
            Found in scripts/apps/archive/directives/ItemLock.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 MetaPlaceDirective has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function MetaPlaceDirective(places: IPlacesService) {
                return {
                    scope: {
                        item: '=',
                        field: '@',
            Severity: Minor
            Found in scripts/apps/authoring/metadata/MetaPlaceDirective.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 getMultiActions has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            export function getMultiActions(
                getSelectedItems: () => Array<IArticle>,
                unselectAll: () => void,
            ) {
                const $location = ng.get('$location');
            Severity: Minor
            Found in scripts/apps/search/controllers/get-multi-actions.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 renderArea has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            export function renderArea(
                area: 'firstLine' | 'secondLine' | 'singleLine' | 'priority',
                itemProps: IItemProps,
                props?: { className?: string },
                customRender: any = {},
            Severity: Minor
            Found in scripts/apps/search/helpers.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 ItemPreview has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            export function ItemPreview(asset, storage, desks, _, familyService, privileges) {
                /**
                 * @description Closes the preview panel if the currently previewed
                 * item is spiked / unspiked or moved.
                 * @param {Object} scope - angular scope
            Severity: Minor
            Found in scripts/apps/search/directives/ItemPreview.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 ItemSearchbar has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            export function ItemSearchbar($location, $document, asset) {
                return {
                    scope: true,
                    templateUrl: asset.templateUrl('apps/search/views/item-searchbar.html'),
                    link: function(scope, elem) {
            Severity: Minor
            Found in scripts/apps/search/directives/ItemSearchbar.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 getBlockAndOffset has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            export const getBlockAndOffset = (
                editorState,
                selection,
                offset,
                startFromEnd = false,
            Severity: Minor
            Found in scripts/core/editor3/helpers/highlights.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 PrivilegesService has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            function PrivilegesService($rootScope, preferencesService) {
                var _privileges = {};
            
                this.privileges = _privileges;
                $rootScope.privileges = _privileges;
            Severity: Minor
            Found in scripts/core/privileges/privileges.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 deleteCurrentSelection has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            const deleteCurrentSelection = (editorState, data, action = 'delete') => {
                let selection = editorState.getSelection();
                let newEditorState;
            
                if (selection.isCollapsed()) {
            Severity: Minor
            Found in scripts/core/editor3/reducers/suggestions.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

            Severity
            Category
            Status
            Source
            Language