superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

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

    render() {
        const {shortFormat} = ng.get('datetime');
        const className = classNames(
            'content-item',
            {'content-item--locked': this.item.lock_user},
Severity: Major
Found in scripts/apps/search/components/WidgetItem.tsx - About 2 hrs to fix

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

        render() {
            const {loading, items} = this.state;
    
            return (
                <div
    Severity: Major
    Found in scripts/core/itemList/LazyLoader.tsx - About 2 hrs to fix

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

          render() {
              if (this.state.visible !== true) {
                  return null;
              }
      
      
      Severity: Major
      Found in scripts/core/ui/components/AutoCompleteSuggestions.tsx - About 2 hrs to fix

        Function getSuggestionData has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function getSuggestionData(editorState, styleName) {
            const type = getHighlightType(styleName);
            const {selection, highlightedText} = getRangeAndTextForStyle(editorState, styleName);
        
            const data = {
        Severity: Major
        Found in scripts/core/editor3/helpers/highlights.ts - About 2 hrs to fix

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

              render() {
                  const {annotation, editorNode, highlightId, highlightsManager, annotationTypes, close} = this.props;
                  const _showPopup = this.props.showPopup;
                  const {author, authorId, date, msg, annotationType} = annotation.data;
                  const {name: type} = annotationTypes.find((t) => t.qcode === annotationType);
          Severity: Major
          Found in scripts/core/editor3/components/annotations/AnnotationPopup.tsx - About 2 hrs to fix

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

                        scope.$watch('brightness', (value, old) => {
                            filter.brightness = 'brightness(' + value + ') ';
                            context['filter'] = filter.brightness + filter.contrast + filter.saturate;
                            context.drawImage(baseImage, 0, 0);
                        });
            Severity: Major
            Found in scripts/core/upload/sdImageModify.ts and 2 other locations - About 2 hrs to fix
            scripts/core/upload/sdImageModify.ts on lines 45..49
            scripts/core/upload/sdImageModify.ts on lines 51..55

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 82.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                handleKeydown(event) {
                    if (event.keyCode === KEYCODES.ESCAPE) {
                        event.preventDefault();
                        this.props.close();
                    }
            Severity: Major
            Found in scripts/apps/contacts/components/Popup/Popup.tsx and 1 other location - About 2 hrs to fix
            scripts/core/ui/components/Popup/Popup.tsx on lines 116..125

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 82.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

                        scope.$watch('contrast', (value, old) => {
                            filter.contrast = 'contrast(' + value + ') ';
                            context['filter'] = filter.brightness + filter.contrast + filter.saturate;
                            context.drawImage(baseImage, 0, 0);
                        });
            Severity: Major
            Found in scripts/core/upload/sdImageModify.ts and 2 other locations - About 2 hrs to fix
            scripts/core/upload/sdImageModify.ts on lines 39..43
            scripts/core/upload/sdImageModify.ts on lines 51..55

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 82.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                handleKeydown(event) {
                    if (event.keyCode === KEYCODES.ESCAPE) {
                        event.preventDefault();
                        this.props.close();
                    }
            Severity: Major
            Found in scripts/core/ui/components/Popup/Popup.tsx and 1 other location - About 2 hrs to fix
            scripts/apps/contacts/components/Popup/Popup.tsx on lines 115..124

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 82.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

                        scope.$watch('saturate', (value, old) => {
                            filter.saturate = 'saturate(' + value + ') ';
                            context['filter'] = filter.brightness + filter.contrast + filter.saturate;
                            context.drawImage(baseImage, 0, 0);
                        });
            Severity: Major
            Found in scripts/core/upload/sdImageModify.ts and 2 other locations - About 2 hrs to fix
            scripts/core/upload/sdImageModify.ts on lines 39..43
            scripts/core/upload/sdImageModify.ts on lines 45..49

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 82.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            class UrgencyComponent extends React.Component<IPropsItemListInfo> {
                render() {
                    const props = this.props;
            
                    return props.item.urgency
            Severity: Major
            Found in scripts/apps/search/components/fields/urgency.tsx and 1 other location - About 2 hrs to fix
            scripts/apps/search/components/fields/priority.tsx on lines 5..18

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 82.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            class PriorityComponent extends React.Component<IPropsItemListInfo> {
                render() {
                    const props = this.props;
            
                    return props.item.priority
            Severity: Major
            Found in scripts/apps/search/components/fields/priority.tsx and 1 other location - About 2 hrs to fix
            scripts/apps/search/components/fields/urgency.tsx on lines 5..16

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 82.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                                    leftPanel={(
                                        this.props.filterPanelOpen === false ? (
                                            <div />
                                        ) : (
                                            <AssetFilterPanel
            scripts/extensions/sams/src/apps/samsWorkspace.tsx on lines 268..278

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 82.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            export const LineInput: React.StatelessComponent<any> = ({
                children,
                required,
                invalid,
                readOnly,
            Severity: Major
            Found in scripts/core/ui/components/Form/LineInput.tsx and 1 other location - About 2 hrs to fix
            scripts/core/editor3/components/toolbar/index.tsx on lines 161..178

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 82.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                            {this.props.original == null ? null : (
                                <PanelContentBlock flex={true}>
                                    <PanelContentBlockInner grow={true}>
                                        <VersionUserDateLines item={this.props.original} />
                                    </PanelContentBlockInner>
            scripts/extensions/sams/src/components/sets/setEditorPanel.tsx on lines 255..261

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 82.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                                {has('undo') && (
                                    <IconButton
                                        onClick={() => {
                                            this.props.dispatch(undo());
                                        }}
            Severity: Major
            Found in scripts/core/editor3/components/toolbar/index.tsx and 1 other location - About 2 hrs to fix
            scripts/core/editor3/components/toolbar/index.tsx on lines 345..354

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 82.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    const {
                        customToolbarStyle,
                        suggestingMode,
                        editorFormat,
                        invisibles,
            Severity: Major
            Found in scripts/core/editor3/components/toolbar/index.tsx and 1 other location - About 2 hrs to fix
            scripts/core/ui/components/Form/LineInput.tsx on lines 10..27

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 82.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    const editors = Object.keys($scope.item[META_FIELD_NAME])
                        .map((contentKey) => ({
                            contentKey: contentKey,
                            [fieldsMetaKeys.draftjsState]: getFieldMetadata(
                                $scope.item,
            Severity: Major
            Found in scripts/apps/authoring/track-changes/inline-comments.ts and 1 other location - About 2 hrs to fix
            scripts/apps/authoring/track-changes/suggestions.ts on lines 48..53

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 82.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    const suggestions = Object.keys($scope.item[META_FIELD_NAME])
                        .map((contentKey) => ({
                            contentKey: contentKey,
                            [fieldsMetaKeys.draftjsState]: getFieldMetadata($scope.item, contentKey, fieldsMetaKeys.draftjsState),
                        }))
            Severity: Major
            Found in scripts/apps/authoring/track-changes/suggestions.ts and 1 other location - About 2 hrs to fix
            scripts/apps/authoring/track-changes/inline-comments.ts on lines 63..72

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 82.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                                {has('redo') && (
                                    <IconButton
                                        onClick={() => {
                                            this.props.dispatch(redo());
                                        }}
            Severity: Major
            Found in scripts/core/editor3/components/toolbar/index.tsx and 1 other location - About 2 hrs to fix
            scripts/core/editor3/components/toolbar/index.tsx on lines 334..343

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 82.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Severity
            Category
            Status
            Source
            Language