superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

Function multiSelectDirective has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function multiSelectDirective() {
    return {
        scope: {
            item: '=',
            list: '=',
Severity: Major
Found in scripts/core/ui/ui.ts - About 2 hrs to fix

    Function constructor has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        constructor(props: any) {
            super(props);
    
            this.state = {
                initialized: false,
    Severity: Major
    Found in scripts/core/ArticlesListV2.tsx - About 2 hrs to fix

      Function constructor has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          constructor() {
              this.openPublishQueue = function() {
                  nav('/publish_queue');
              };
      
      
      Severity: Major
      Found in e2e/client/specs/helpers/publish_queue.ts - About 2 hrs to fix

        Function PasswordStrength has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function PasswordStrength() {
            // styles holds each of the strength labels by index along with the class
            // to be added to the indicator.
            var styles = [
                {txt: gettext('Short'), cls: 'red'},
        Severity: Major
        Found in scripts/core/directives/PasswordStrengthDirective.ts - About 2 hrs to fix

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

              getEditor3Fields() {
                  const {contentProfile} = this.props;
                  const allFields = contentProfile.header.merge(contentProfile.content);
          
                  return allFields.filter((field) => field.fieldType === 'editor3').toArray();
          scripts/apps/authoring-react/article-widgets/suggestions.tsx on lines 150..155

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

          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

              getEditor3Fields() {
                  const {contentProfile} = this.props;
                  const allFields = contentProfile.header.merge(contentProfile.content);
          
                  return allFields.filter((field) => field.fieldType === 'editor3').toArray();
          Severity: Major
          Found in scripts/apps/authoring-react/article-widgets/suggestions.tsx and 1 other location - About 2 hrs to fix
          scripts/apps/authoring-react/generic-widgets/inline-comments.tsx on lines 104..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 78.

          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

                  return (
                      <SpacerInlineFlex h gap="8" gapSecondary="8">
                          {
                              optionsToPreview.map((option, i) => (
                                  <DropdownItemTemplate key={i} option={option} config={config} noPadding={noPadding} />
          scripts/apps/authoring-react/fields/dropdown/dropdown-vocabulary/preview.tsx on lines 20..28

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

          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 isLockedInOtherSession<T extends ILockInfo>(entity: T): boolean {
              if (entity._lock !== true) {
                  return false;
              }
          
          
          scripts/apps/authoring-react/subcomponents/lock-info-generic.tsx on lines 11..19

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

          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

              removeItem(idToRemove: IArticle['_id']) {
                  const linkedItems = this.props.value ?? [];
          
                  this.props.onChange(
                      linkedItems.filter(({id}) => id !== idToRemove),
          Severity: Major
          Found in scripts/apps/authoring-react/fields/linked-items/editor.tsx and 1 other location - About 2 hrs to fix
          scripts/apps/authoring-react/fields/package-items/editor.tsx on lines 89..95

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

          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

              function duplicateTo() {
                  dispatchInternalEvent('interactiveArticleActionStart', {
                      items: getSelectedItems(),
                      tabs: ['duplicate_to'],
                      activeTab: 'duplicate_to',
          Severity: Major
          Found in scripts/apps/search/controllers/get-multi-actions.tsx and 1 other location - About 2 hrs to fix
          scripts/apps/search/controllers/get-multi-actions.tsx on lines 198..210

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

          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

                  return (
                      <SpacerInlineFlex h gap="8" gapSecondary="8">
                          {
                              optionsToPreview.map((option, i) => (
                                  <DropdownItemTemplate key={i} option={option} config={config} noPadding={noPadding} />
          scripts/apps/authoring-react/fields/dropdown/dropdown-manual-entry/preview.tsx on lines 26..34

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

          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 isLockedInCurrentSession<T extends ILockInfo>(entity: T): boolean {
              if (entity._lock !== true) {
                  return false;
              }
          
          
          scripts/apps/authoring-react/subcomponents/lock-info-generic.tsx on lines 21..29

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

          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

              closeOnMouseLeave(event: MouseEvent) {
                  if (this.wrapperEl == null) {
                      return;
                  }
          
          
          Severity: Major
          Found in scripts/core/ui/components/popupNew.tsx and 1 other location - About 2 hrs to fix
          scripts/core/ui/components/popupNew.tsx on lines 41..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 78.

          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

              function unspikeItems() {
                  dispatchInternalEvent('interactiveArticleActionStart', {
                      items: getSelectedItems(),
                      tabs: ['unspike'],
                      activeTab: 'unspike',
          Severity: Major
          Found in scripts/apps/search/controllers/get-multi-actions.tsx and 1 other location - About 2 hrs to fix
          scripts/apps/search/controllers/get-multi-actions.tsx on lines 233..245

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

          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

              removeItem(idToRemove: IArticle['_id']) {
                  const linkedItems = this.props.value ?? [];
          
                  this.props.onChange(
                      linkedItems.filter(({guid}) => guid !== idToRemove),
          Severity: Major
          Found in scripts/apps/authoring-react/fields/package-items/editor.tsx and 1 other location - About 2 hrs to fix
          scripts/apps/authoring-react/fields/linked-items/editor.tsx on lines 92..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 78.

          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

              closeOnScroll(event: MouseEvent) {
                  if (this.wrapperEl == null) {
                      return;
                  }
          
          
          Severity: Major
          Found in scripts/core/ui/components/popupNew.tsx and 1 other location - About 2 hrs to fix
          scripts/core/ui/components/popupNew.tsx on lines 51..59

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

          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

          File VideoTimeline.tsx has 256 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import * as React from 'react';
          import {BarIcon} from './BarIcon';
          import {ListThumbnails} from './ListThumbnails';
          import {IThumbnail} from '../interfaces';
          
          
          Severity: Minor
          Found in scripts/extensions/videoEditor/src/VideoTimeline/VideoTimeline.tsx - About 2 hrs to fix

            File versions-tab.tsx has 256 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import React from 'react';
            import {uniq} from 'lodash';
            import {
                IArticle,
                IExtensionActivationResult,

              Function MetaPlaceDirective has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function MetaPlaceDirective(places: IPlacesService) {
                  return {
                      scope: {
                          item: '=',
                          field: '@',
              Severity: Major
              Found in scripts/apps/authoring/metadata/MetaPlaceDirective.ts - About 2 hrs to fix

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

                    render() {
                        const showUpload = this.props.attachments.length < appConfig.attachments_max_files && !this.props.readOnly;
                
                        return (
                            <div
                Severity: Major
                Found in scripts/apps/authoring/attachments/AttachmentsWidgetComponent.tsx - About 2 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language