superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

Function LockService has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function LockService($q, api, session, privileges, notify) {
    /**
     * Lock an item
     */
    this.lock = function lock(item, force, action) {
Severity: Major
Found in scripts/apps/authoring/authoring/services/LockService.ts - About 2 hrs to fix

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

            link: function(scope, elem) {
                scope.multiInputFields = ['place', 'genre', 'anpa_category', 'subject', 'authors'];
                scope.getLocaleName = metadata.getLocaleName;
    
                scope.select = function(item) {
    Severity: Major
    Found in scripts/apps/authoring/metadata/metadata.ts - About 2 hrs to fix

      Function MetaWordsListDirective has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Function TranslationReactDropdown has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function TranslationReactDropdown(item, className, TranslationService, noLanguagesLabel) {
            var languages = TranslationService.get() || {_items: []};
        
            interface ITranslateBtnProps {
                item: any;
        Severity: Major
        Found in scripts/apps/translations/directives/TranslationReactDropdown.ts - About 2 hrs to fix

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

                  link: function(scope, element, attrs, controller) {
                      scope.config = appConfig;
                      scope.toggleFiltersPane = controller.toggleFiltersPane;
                      scope.sTab = 'advancedSearch';
                      scope.innerTab = 'parameters';
          Severity: Major
          Found in scripts/apps/search/directives/SearchPanel.ts - About 2 hrs to fix

            Function showOptionsModal has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function showOptionsModal(title: string, message: string, options: Array<IOption>, dataTestId?: string): void {
                class OptionsModal extends React.PureComponent<IProps, IState> {
                    constructor(props: IProps) {
                        super(props);
            
            
            Severity: Major
            Found in scripts/core/ui/components/options-modal.tsx - About 2 hrs to fix

              Function reducer has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function reducer(state: IStoreState = initialState, action: IAction): IStoreState {
                  switch (action.type) {
                  /**
                   * USER ACTIONS
                   */
              Severity: Major
              Found in scripts/core/data/index.ts - About 2 hrs to fix

                File MonitoringView.ts has 253 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import _ from 'lodash';
                import {gettext} from 'core/utils';
                import {AuthoringWorkspaceService} from 'apps/authoring/authoring/services/AuthoringWorkspaceService';
                import {IDesk, ISuperdeskQuery, IUser} from 'superdesk-api';
                
                
                Severity: Minor
                Found in scripts/apps/monitoring/directives/MonitoringView.ts - About 2 hrs to fix

                  File UserPreferencesDirective.ts has 253 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /* eslint-disable max-len */
                  /* tslint:disable:max-line-length */
                  import {gettext} from 'core/utils';
                  import {appConfig, getUserInterfaceLanguage} from 'appConfig';
                  import {applyDefault} from 'core/helpers/typescript-helpers';
                  Severity: Minor
                  Found in scripts/apps/users/directives/UserPreferencesDirective.ts - About 2 hrs to fix

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

                            this.eventListenersToRemove.push(
                                addWebsocketEventListener(
                                    'resource:updated',
                                    (event: IWebsocketMessage<IResourceUpdateEvent>) => {
                                        const {resource} = event.extra;
                    Severity: Major
                    Found in scripts/apps/system-messages/components/system-messages.tsx and 2 other locations - About 2 hrs to fix
                    scripts/apps/system-messages/components/system-messages.tsx on lines 37..48
                    scripts/apps/system-messages/components/system-messages.tsx on lines 50..61

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

                    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

                            this.eventListenersToRemove.push(
                                addWebsocketEventListener(
                                    'resource:deleted',
                                    (event: IWebsocketMessage<IResourceDeletedEvent>) => {
                                        const {resource} = event.extra;
                    Severity: Major
                    Found in scripts/apps/system-messages/components/system-messages.tsx and 2 other locations - About 2 hrs to fix
                    scripts/apps/system-messages/components/system-messages.tsx on lines 24..35
                    scripts/apps/system-messages/components/system-messages.tsx on lines 37..48

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

                    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

                            this.eventListenersToRemove.push(
                                addWebsocketEventListener(
                                    'resource:created',
                                    (event: IWebsocketMessage<IResourceCreatedEvent>) => {
                                        const {resource} = event.extra;
                    Severity: Major
                    Found in scripts/apps/system-messages/components/system-messages.tsx and 2 other locations - About 2 hrs to fix
                    scripts/apps/system-messages/components/system-messages.tsx on lines 24..35
                    scripts/apps/system-messages/components/system-messages.tsx on lines 50..61

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

                    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

                                                <Select
                                                    label={gettext('State')}
                                                    value={this.props.asset.state}
                                                    required={true}
                                                    onChange={this.onChange.state}
                    scripts/extensions/sams/src/components/assets/assetEditor.tsx on lines 245..257

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

                    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

                            if (event.key === 'ArrowUp' || event.key === 'ArrowLeft') {
                                const prevEl = document.activeElement.previousElementSibling;
                    
                                if (prevEl instanceof HTMLElement) {
                                    // Don't scroll the list. The list will be scrolled automatically
                    Severity: Major
                    Found in scripts/apps/search/components/ItemList.tsx and 1 other location - About 2 hrs to fix
                    scripts/apps/search/components/ItemList.tsx on lines 438..448

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

                    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

                            if (event.key === 'ArrowDown' || event.key === 'ArrowRight') {
                                const nextEl = document.activeElement.nextElementSibling;
                    
                                if (nextEl instanceof HTMLElement) {
                                    // Don't scroll the list. The list will be scrolled automatically
                    Severity: Major
                    Found in scripts/apps/search/components/ItemList.tsx and 1 other location - About 2 hrs to fix
                    scripts/apps/search/components/ItemList.tsx on lines 450..460

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

                    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

                                                <Select
                                                    label={gettext('Set')}
                                                    value={this.props.asset.set_id}
                                                    required={true}
                                                    onChange={this.onChange.set_id}
                    scripts/extensions/sams/src/components/assets/assetEditor.tsx on lines 216..238

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

                    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 macros.ts has 252 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /**
                     * @ngdoc service
                     * @module superdesk.apps.authoring.macros
                     * @name macros
                     * @requires api
                    Severity: Minor
                    Found in scripts/apps/authoring/macros/macros.ts - About 2 hrs to fix

                      Function getRundownItemTemplateAuthoringStorage has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function getRundownItemTemplateAuthoringStorage(
                          item: IRundownItemTemplateInitial,
                          onSave: (item: IRundownItemTemplateInitial) => Promise<IRundownItemTemplateInitial>,
                      ): IAuthoringStorage<IRundownItemTemplateInitial> {
                          class AutoSaveRundownItem implements IAuthoringAutoSave<IRundownItemTemplateInitial> {
                      Severity: Major
                      Found in scripts/extensions/broadcasting/src/rundowns/prepare-create-edit.ts - About 2 hrs to fix

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

                            render() {
                                const fields = this.props.value;
                                const {readOnly, validationErrors} = this.props;
                        
                                return (

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

                              render() {
                                  const Container = this.props.container;
                          
                                  return (
                                      <Container>
                          Severity: Major
                          Found in scripts/apps/authoring-react/fields/dateline/editor.tsx - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language