superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

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

    render() {
        const {item, itemSelected, multiSelect} = this.props;

        return (
            <div>
Severity: Minor
Found in scripts/apps/search/components/ItemListTemplate.tsx - About 1 hr to fix

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

        render() {
            if (this.state.actionsFromExtensions == null) {
                return null;
            }
    
    
    Severity: Minor
    Found in scripts/apps/search/components/actions-menu/MenuItems.tsx - About 1 hr to fix

      Function getDateFilters has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const getDateFilters = () => {
          const ranges = getDateRangesByKey();
      
          return [
              {
      Severity: Minor
      Found in scripts/apps/search/directives/DateFilters.ts - About 1 hr to fix

        Function PhotoDeskFooter has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const PhotoDeskFooter: React.StatelessComponent<IProps> = (props) => {
            const {item} = props;
            const gridViewFooterFieldsConfig = appConfig.gridViewFooterFields ?? DEFAULT_GRID_VIEW_FOOTER_CONFIG;
        
            const fieldsLeft = gridViewFooterFieldsConfig.left;
        Severity: Minor
        Found in scripts/apps/search/components/PhotoDeskFooter.tsx - About 1 hr to fix

          Function adjust has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      function adjust() {
                          var taHeight,
                              taComputedStyleWidth,
                              mirrorHeight,
                              width,
          Severity: Minor
          Found in scripts/core/ui/autoheight-directive.ts - About 1 hr to fix

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

                render() {
                    const className = (
                        this.props.className != null ? this.props.className : 'item-association'
                    ) + (this.state.hover ? ' dragover' : '');
            
            
            Severity: Minor
            Found in scripts/core/ui/components/drop-zone.tsx - About 1 hr to fix

              Function getBlockAndOffset has 35 lines of code (exceeds 25 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

                Function getTemplateForHeader has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                                    const getTemplateForHeader = () => {
                                        return (
                                            <div style={{display: 'flex'}} className="sd-input-style">
                                                <div className="authoring-header__item-label">
                                                    {fieldName}
                Severity: Minor
                Found in scripts/core/editor3/directive.tsx - About 1 hr to fix

                  Function deleteCurrentSelection has 35 lines of code (exceeds 25 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

                    Function getSpellcheckWarningsByBlock has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function getSpellcheckWarningsByBlock(
                        spellchecker: ISpellchecker,
                        editorState: EditorState,
                    ): Promise<ISpellcheckWarningsByBlock> {
                        const text = editorState.getCurrentContent().getPlainText();

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

                          render() {
                              if (this.state.itemCount === 'loading') {
                                  return null;
                              }
                      
                      
                      Severity: Minor
                      Found in scripts/core/ArticlesListByQuery.tsx - About 1 hr to fix

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

                                                                    <FormRow>
                                                                        <FormLabel text={gettext('Filename')} style="light" />
                                                                        <Text>{this.props.asset?.filename}</Text>
                                                                    </FormRow>
                        scripts/extensions/sams/src/components/assets/assetImagePreviewFullScreen.tsx on lines 125..128
                        scripts/extensions/sams/src/components/assets/assetPreviewPanel.tsx on lines 157..160
                        scripts/extensions/sams/src/components/assets/assetPreviewPanel.tsx on lines 167..170
                        scripts/extensions/sams/src/components/assets/assetPreviewPanel.tsx on lines 185..188

                        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 63.

                        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

                                {
                                    labelBlock: gettext('Date published'),
                                    labelFrom: gettext('Published from'),
                                    labelTo: gettext('Published to'),
                                    fieldname: 'firstpublished',
                        Severity: Major
                        Found in scripts/apps/search/directives/DateFilters.ts and 2 other locations - About 1 hr to fix
                        scripts/apps/search/directives/DateFilters.ts on lines 75..82
                        scripts/apps/search/directives/DateFilters.ts on lines 83..90

                        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 63.

                        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 5 locations. Consider refactoring.
                        Open

                                                    <FormRow>
                                                        <FormLabel text={gettext('Filename')} style="light" />
                                                        <Text>{this.props.asset?.filename}</Text>
                                                    </FormRow>
                        scripts/extensions/sams/src/components/assets/assetImagePreviewFullScreen.tsx on lines 125..128
                        scripts/extensions/sams/src/components/assets/assetImagePreviewFullScreen.tsx on lines 135..138
                        scripts/extensions/sams/src/components/assets/assetPreviewPanel.tsx on lines 157..160
                        scripts/extensions/sams/src/components/assets/assetPreviewPanel.tsx on lines 185..188

                        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 63.

                        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 5 locations. Consider refactoring.
                        Open

                                                    <FormRow>
                                                        <FormLabel text={gettext('State')} style="light" />
                                                        <Text>{this.props.asset?.state}</Text>
                                                    </FormRow>
                        scripts/extensions/sams/src/components/assets/assetImagePreviewFullScreen.tsx on lines 125..128
                        scripts/extensions/sams/src/components/assets/assetImagePreviewFullScreen.tsx on lines 135..138
                        scripts/extensions/sams/src/components/assets/assetPreviewPanel.tsx on lines 157..160
                        scripts/extensions/sams/src/components/assets/assetPreviewPanel.tsx on lines 167..170

                        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 63.

                        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 5 locations. Consider refactoring.
                        Open

                                                                    <FormRow>
                                                                        <FormLabel text={gettext('Name')} style="light" />
                                                                        <Text>{this.props.asset?.name}</Text>
                                                                    </FormRow>
                        scripts/extensions/sams/src/components/assets/assetImagePreviewFullScreen.tsx on lines 135..138
                        scripts/extensions/sams/src/components/assets/assetPreviewPanel.tsx on lines 157..160
                        scripts/extensions/sams/src/components/assets/assetPreviewPanel.tsx on lines 167..170
                        scripts/extensions/sams/src/components/assets/assetPreviewPanel.tsx on lines 185..188

                        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 63.

                        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 5 locations. Consider refactoring.
                        Open

                                                    <FormRow>
                                                        <FormLabel text={gettext('Name')} style="light" />
                                                        <Text>{this.props.asset?.name}</Text>
                                                    </FormRow>
                        scripts/extensions/sams/src/components/assets/assetImagePreviewFullScreen.tsx on lines 125..128
                        scripts/extensions/sams/src/components/assets/assetImagePreviewFullScreen.tsx on lines 135..138
                        scripts/extensions/sams/src/components/assets/assetPreviewPanel.tsx on lines 167..170
                        scripts/extensions/sams/src/components/assets/assetPreviewPanel.tsx on lines 185..188

                        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 63.

                        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

                                {
                                    labelBlock: gettext('Date modified'),
                                    labelFrom: gettext('Modified from'),
                                    labelTo: gettext('Modified to'),
                                    fieldname: 'versioncreated',
                        Severity: Major
                        Found in scripts/apps/search/directives/DateFilters.ts and 2 other locations - About 1 hr to fix
                        scripts/apps/search/directives/DateFilters.ts on lines 75..82
                        scripts/apps/search/directives/DateFilters.ts on lines 91..98

                        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 63.

                        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

                                                                    {
                                                                        gettext('Modified at {{time}} by {{user}}', {
                                                                            time: () => <DateTime dateTime={template.value._updated} />,
                                                                            user: () => <strong>{userUpdater.display_name}</strong>,
                                                                        })
                        scripts/extensions/broadcasting/src/rundown-templates/manage-rundown-templates.tsx on lines 164..169

                        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 63.

                        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 function setCustomDataForEditor__deprecated(editorState, key, value) {
                            if (!keyValid(key)) {
                                throw new Error(`Key '${key}' is not defined`);
                            }
                        
                        
                        Severity: Major
                        Found in scripts/core/editor3/helpers/editor3CustomData.ts and 1 other location - About 1 hr to fix
                        scripts/core/editor3/helpers/editor3CustomData.ts on lines 103..109

                        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 63.

                        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