superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

Function getRelevantCharactersForCollapsedSelection has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getRelevantCharactersForCollapsedSelection(
    editorState: EditorState,
    collapsedSelection: SelectionState,
): List<CharacterMetadata> {
    let characters = List<CharacterMetadata>();
Severity: Minor
Found in scripts/core/editor3/helpers/handleBeforeInputHighlights.ts - About 1 hr to fix

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

        constructor(props: IProps) {
            super(props);
    
            this.onChangeInterceptor = this.onChangeInterceptor.bind(this);
    
    
    Severity: Minor
    Found in scripts/core/editor3/react.tsx - About 1 hr to fix

      Function suggestions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const suggestions = (state = {}, action) => {
          switch (action.type) {
          case 'TOGGLE_SUGGESTING_MODE':
              return toggleSuggestingMode(state);
          case 'CREATE_ADD_SUGGESTION':
      Severity: Minor
      Found in scripts/core/editor3/reducers/suggestions.tsx - About 1 hr to fix

        Function renderAttachment has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            renderAttachment() {
                return (
                    <div>
                        <div style={{height: '24rem', overflowY: 'scroll'}}>
                            <AttachmentList
        Severity: Minor
        Found in scripts/core/editor3/components/links/LinkInput.tsx - About 1 hr to fix

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

                          link: function(scope, elem, attrs, ctrl) {
                              scope.emptyState = emptyState;
          
                              // merged from all extensions
                              const notificationsKeyed: IExtensionActivationResult['contributions']['notifications'] = {};
          Severity: Minor
          Found in scripts/core/menu/notifications/notifications.ts - About 1 hr to fix

            Function getErrorsModal has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function getErrorsModal(
                title: string,
                errors: Array<string>,
                description?: string,
            ) {
            Severity: Minor
            Found in scripts/core/services/modalService.tsx - About 1 hr to fix

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

                  if (
                      field?.id != null
                      && (
                          schema[field.id].type === 'media'
                          || (
              scripts/apps/workspace/content/components/get-content-profiles-form-config.tsx on lines 189..198
              scripts/apps/workspace/content/components/get-content-profiles-form-config.tsx on lines 202..211
              scripts/apps/workspace/content/components/get-content-profiles-form-config.tsx on lines 213..222
              scripts/apps/workspace/content/components/get-content-profiles-form-config.tsx on lines 226..242
              scripts/apps/workspace/content/components/get-content-profiles-form-config.tsx on lines 265..274

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

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

              SlidingToolBar.propTypes = {
                  hide: PropTypes.bool,
                  onCancel: PropTypes.func,
                  innerInfo: PropTypes.string,
                  innerTools: PropTypes.node,
              Severity: Major
              Found in scripts/core/ui/components/SubNav/SlidingToolBar.tsx and 7 other locations - About 1 hr to fix
              scripts/apps/packaging/components/PackageGroupList.tsx on lines 45..51
              scripts/core/editor3/components/toolbar/BlockStyleButtons.tsx on lines 89..95
              scripts/core/editor3/components/toolbar/InlineStyleButtons.tsx on lines 64..70
              scripts/core/ui/components/Dropdown/Dropdown.tsx on lines 27..33
              scripts/core/ui/components/Dropdown/Menu.tsx on lines 28..34
              scripts/core/ui/components/SidePanel/SidePanel.tsx on lines 26..32
              scripts/core/ui/components/Toggle/index.tsx on lines 47..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 57.

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

                  if (
                      field?.id != null
                      && characterValidationEnabled
                      && (
                          schema[field.id]?.type === 'string'
              scripts/apps/workspace/content/components/get-content-profiles-form-config.tsx on lines 189..198
              scripts/apps/workspace/content/components/get-content-profiles-form-config.tsx on lines 202..211
              scripts/apps/workspace/content/components/get-content-profiles-form-config.tsx on lines 213..222
              scripts/apps/workspace/content/components/get-content-profiles-form-config.tsx on lines 265..274
              scripts/apps/workspace/content/components/get-content-profiles-form-config.tsx on lines 276..294

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

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

              SidePanel.propTypes = {
                  children: PropTypes.node,
                  shadowRight: PropTypes.bool,
                  shadowLeft: PropTypes.bool,
                  transparent: PropTypes.bool,
              Severity: Major
              Found in scripts/core/ui/components/SidePanel/SidePanel.tsx and 7 other locations - About 1 hr to fix
              scripts/apps/packaging/components/PackageGroupList.tsx on lines 45..51
              scripts/core/editor3/components/toolbar/BlockStyleButtons.tsx on lines 89..95
              scripts/core/editor3/components/toolbar/InlineStyleButtons.tsx on lines 64..70
              scripts/core/ui/components/Dropdown/Dropdown.tsx on lines 27..33
              scripts/core/ui/components/Dropdown/Menu.tsx on lines 28..34
              scripts/core/ui/components/SubNav/SlidingToolBar.tsx on lines 29..35
              scripts/core/ui/components/Toggle/index.tsx on lines 47..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 57.

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

              Dropdown.propTypes = {
                  children: PropTypes.node,
                  className: PropTypes.string,
                  isOpen: PropTypes.bool,
                  alignRight: PropTypes.bool,
              Severity: Major
              Found in scripts/core/ui/components/Dropdown/Dropdown.tsx and 7 other locations - About 1 hr to fix
              scripts/apps/packaging/components/PackageGroupList.tsx on lines 45..51
              scripts/core/editor3/components/toolbar/BlockStyleButtons.tsx on lines 89..95
              scripts/core/editor3/components/toolbar/InlineStyleButtons.tsx on lines 64..70
              scripts/core/ui/components/Dropdown/Menu.tsx on lines 28..34
              scripts/core/ui/components/SidePanel/SidePanel.tsx on lines 26..32
              scripts/core/ui/components/SubNav/SlidingToolBar.tsx on lines 29..35
              scripts/core/ui/components/Toggle/index.tsx on lines 47..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 57.

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

              InlineStyleButtonsComponent.propTypes = {
                  editorState: PropTypes.object,
                  editorFormat: PropTypes.array,
                  suggestingMode: PropTypes.bool,
                  toggleInlineStyle: PropTypes.func,
              scripts/apps/packaging/components/PackageGroupList.tsx on lines 45..51
              scripts/core/editor3/components/toolbar/BlockStyleButtons.tsx on lines 89..95
              scripts/core/ui/components/Dropdown/Dropdown.tsx on lines 27..33
              scripts/core/ui/components/Dropdown/Menu.tsx on lines 28..34
              scripts/core/ui/components/SidePanel/SidePanel.tsx on lines 26..32
              scripts/core/ui/components/SubNav/SlidingToolBar.tsx on lines 29..35
              scripts/core/ui/components/Toggle/index.tsx on lines 47..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 57.

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

              PackageGroupList.propTypes = {
                  package: PropTypes.object,
                  api: PropTypes.func,
                  item: PropTypes.object,
                  className: PropTypes.any,
              Severity: Major
              Found in scripts/apps/packaging/components/PackageGroupList.tsx and 7 other locations - About 1 hr to fix
              scripts/core/editor3/components/toolbar/BlockStyleButtons.tsx on lines 89..95
              scripts/core/editor3/components/toolbar/InlineStyleButtons.tsx on lines 64..70
              scripts/core/ui/components/Dropdown/Dropdown.tsx on lines 27..33
              scripts/core/ui/components/Dropdown/Menu.tsx on lines 28..34
              scripts/core/ui/components/SidePanel/SidePanel.tsx on lines 26..32
              scripts/core/ui/components/SubNav/SlidingToolBar.tsx on lines 29..35
              scripts/core/ui/components/Toggle/index.tsx on lines 47..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 57.

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

                  if (field?.id != null && customField != null && customField.field_type == null) {
                      const showInPreviewField: IFormField = {
                          label: gettext('Show in preview'),
                          type: FormFieldType.checkbox,
                          field: 'preview',
              scripts/apps/workspace/content/components/get-content-profiles-form-config.tsx on lines 189..198
              scripts/apps/workspace/content/components/get-content-profiles-form-config.tsx on lines 213..222
              scripts/apps/workspace/content/components/get-content-profiles-form-config.tsx on lines 226..242
              scripts/apps/workspace/content/components/get-content-profiles-form-config.tsx on lines 265..274
              scripts/apps/workspace/content/components/get-content-profiles-form-config.tsx on lines 276..294

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

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

                  if (field?.id != null && field.id === 'feature_media' && schema[field.id].type === 'media') {
                      const showCropsField: IFormField = {
                          label: gettext('Show Crops'),
                          type: FormFieldType.checkbox,
                          field: 'showCrops',
              scripts/apps/workspace/content/components/get-content-profiles-form-config.tsx on lines 189..198
              scripts/apps/workspace/content/components/get-content-profiles-form-config.tsx on lines 202..211
              scripts/apps/workspace/content/components/get-content-profiles-form-config.tsx on lines 213..222
              scripts/apps/workspace/content/components/get-content-profiles-form-config.tsx on lines 226..242
              scripts/apps/workspace/content/components/get-content-profiles-form-config.tsx on lines 276..294

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

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

              BlockStyleButtonsComponent.propTypes = {
                  editorState: PropTypes.object,
                  suggestingMode: PropTypes.bool,
                  editorFormat: PropTypes.array,
                  toggleBlockStyle: PropTypes.func,
              scripts/apps/packaging/components/PackageGroupList.tsx on lines 45..51
              scripts/core/editor3/components/toolbar/InlineStyleButtons.tsx on lines 64..70
              scripts/core/ui/components/Dropdown/Dropdown.tsx on lines 27..33
              scripts/core/ui/components/Dropdown/Menu.tsx on lines 28..34
              scripts/core/ui/components/SidePanel/SidePanel.tsx on lines 26..32
              scripts/core/ui/components/SubNav/SlidingToolBar.tsx on lines 29..35
              scripts/core/ui/components/Toggle/index.tsx on lines 47..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 57.

              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

                          scope.openSingleItem = function(packageItem) {
                              packages.fetchItem(packageItem).then((item) => {
                                  scope.selected.view = item;
                              });
                          };
              Severity: Major
              Found in scripts/apps/archive/directives/ContentResults.ts and 1 other location - About 1 hr to fix
              scripts/apps/search/directives/SearchResults.ts on lines 545..549

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

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

              Toggle.propTypes = {
                  value: PropTypes.bool,
                  onChange: PropTypes.func,
                  onFocus: PropTypes.func,
                  readOnly: PropTypes.bool,
              Severity: Major
              Found in scripts/core/ui/components/Toggle/index.tsx and 7 other locations - About 1 hr to fix
              scripts/apps/packaging/components/PackageGroupList.tsx on lines 45..51
              scripts/core/editor3/components/toolbar/BlockStyleButtons.tsx on lines 89..95
              scripts/core/editor3/components/toolbar/InlineStyleButtons.tsx on lines 64..70
              scripts/core/ui/components/Dropdown/Dropdown.tsx on lines 27..33
              scripts/core/ui/components/Dropdown/Menu.tsx on lines 28..34
              scripts/core/ui/components/SidePanel/SidePanel.tsx on lines 26..32
              scripts/core/ui/components/SubNav/SlidingToolBar.tsx on lines 29..35

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

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

              Menu.propTypes = {
                  children: PropTypes.node,
                  className: PropTypes.string,
                  isOpen: PropTypes.bool,
                  alignRight: PropTypes.bool,
              Severity: Major
              Found in scripts/core/ui/components/Dropdown/Menu.tsx and 7 other locations - About 1 hr to fix
              scripts/apps/packaging/components/PackageGroupList.tsx on lines 45..51
              scripts/core/editor3/components/toolbar/BlockStyleButtons.tsx on lines 89..95
              scripts/core/editor3/components/toolbar/InlineStyleButtons.tsx on lines 64..70
              scripts/core/ui/components/Dropdown/Dropdown.tsx on lines 27..33
              scripts/core/ui/components/SidePanel/SidePanel.tsx on lines 26..32
              scripts/core/ui/components/SubNav/SlidingToolBar.tsx on lines 29..35
              scripts/core/ui/components/Toggle/index.tsx on lines 47..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 57.

              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

                          scope.openSingleItem = function(packageItem) {
                              packages.fetchItem(packageItem).then((item) => {
                                  scope.selected.view = item;
                              });
                          };
              Severity: Major
              Found in scripts/apps/search/directives/SearchResults.ts and 1 other location - About 1 hr to fix
              scripts/apps/archive/directives/ContentResults.ts on lines 50..54

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

              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