superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

Function AggregateSettings has 261 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function AggregateSettings(desks, workspaces, session, preferencesService, WizardHandler, $filter) {
    return {
        templateUrl: 'scripts/apps/monitoring/views/aggregate-settings-configuration.html',
        scope: {
            modalActive: '=',
Severity: Major
Found in scripts/apps/monitoring/directives/AggregateSettings.ts - About 1 day to fix

    Function SpellcheckService has 256 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function SpellcheckService($q, api, dictionaries, $rootScope, $location, _, preferencesService) {
        var PREFERENCES_KEY = 'spellchecker:status',
            lang = getUserInterfaceLanguage(),
            dict = {} as any,
            ignored = {},
    Severity: Major
    Found in scripts/core/spellcheck/spellcheck.ts - About 1 day to fix

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

          render() {
              const {rundownAction} = this.state;
              const rundownItemOpen = rundownAction != null && this.state.rundownItemAction != null;
              const rundownsListVisible = rundownAction?.fullWidth !== true && !rundownItemOpen;
      
      
      Severity: Major
      Found in scripts/extensions/broadcasting/src/page.tsx - About 1 day to fix

        Function PublishQueueController has 251 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function PublishQueueController($scope, subscribersService, api, $q, notify, $location, ingestSources,
            vocabularies) {
            $scope.subscribers = null;
            $scope.subscriberLookup = {};
            $scope.ingestProviders = null;
        Severity: Major
        Found in scripts/apps/publish/controllers/PublishQueueController.ts - About 1 day to fix

          Function ArticleEditDirective has 251 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function ArticleEditDirective(
              autosave,
              metadata,
              $filter,
              superdesk,
          Severity: Major
          Found in scripts/apps/authoring/authoring/directives/ArticleEditDirective.ts - About 1 day to fix

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

            angular
                .module('superdesk.apps.authoring.track-changes.inline-comments', [
                    'superdesk.apps.authoring.widgets',
                ])
                .config([
            Severity: Major
            Found in scripts/apps/authoring/track-changes/inline-comments.ts and 1 other location - About 1 day to fix
            scripts/apps/authoring/track-changes/suggestions.ts on lines 82..126

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

            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

            angular
                .module('superdesk.apps.authoring.track-changes.suggestions', [
                    'superdesk.apps.authoring.widgets',
                ])
                .config([
            Severity: Major
            Found in scripts/apps/authoring/track-changes/suggestions.ts and 1 other location - About 1 day to fix
            scripts/apps/authoring/track-changes/inline-comments.ts on lines 128..172

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

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

            import {
                getParameters,
                getExcludeFacets,
                CORE_PROJECTED_FIELDS,
                DEFAULT_LIST_CONFIG,
            Severity: Major
            Found in scripts/apps/search/services/SearchService.ts - About 1 day to fix

              Function ItemCarouselDirective has 247 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function ItemCarouselDirective(notify, relationsService) {
                  return {
                      scope: {
                          allowAudio: '<',
                          allowPicture: '<',
              Severity: Major
              Found in scripts/apps/authoring/authoring/directives/ItemCarouselDirective.ts - About 1 day to fix

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

                        link: function(scope: IScope, elem) {
                            getLabelNameResolver().then((getLabelForFieldId) => {
                                scope.handleUrlsChange = function(fieldId, value) {
                                    if (!scope.item.extra) {
                                        scope.item.extra = {};
                Severity: Major
                Found in scripts/apps/authoring/authoring/directives/ArticleEditDirective.ts - About 1 day to fix

                  File MonitoringGroup.ts has 575 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /* eslint-disable complexity */
                  import _, {debounce} from 'lodash';
                  import getCustomSortForGroup, {GroupSortOptions} from '../helpers/CustomSortOfGroups';
                  import {GET_LABEL_MAP, getLabelForStage} from '../../workspace/content/constants';
                  import {isPublished} from 'apps/archive/utils';
                  Severity: Major
                  Found in scripts/apps/monitoring/directives/MonitoringGroup.ts - About 1 day to fix

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

                        render() {
                            return (
                                <WithSizeObserver style={{display: 'flex', margin: -4}}>
                                    {({width, height}) => (
                                        <VirtualListFromQuery
                    Severity: Major
                    Found in scripts/extensions/broadcasting/src/rundowns/rundowns-list.tsx - About 1 day to fix

                      File IngestSourcesContent.ts has 572 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import _, {throttle} from 'lodash';
                      import {cloneDeep} from 'lodash';
                      import {gettext} from 'core/utils';
                      import {appConfig} from 'appConfig';
                      import {IBaseRestApiResponse} from 'superdesk-api';
                      Severity: Major
                      Found in scripts/apps/ingest/directives/IngestSourcesContent.ts - About 1 day to fix

                        Function UserPreferencesDirective has 241 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function UserPreferencesDirective(
                            session, preferencesService, notify, asset, metadata, desks, modal,
                            $timeout, $q, userList, _, search, authThemes,
                        ) {
                            // human readable labels for server values
                        Severity: Major
                        Found in scripts/apps/users/directives/UserPreferencesDirective.ts - About 1 day to fix

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

                                  link: function(scope, elem) {
                                      var PREFERENCES_KEY = 'agg:view';
                                      var defaultMaxItems = 10;
                          
                                      scope.showGlobalSavedSearches = false;
                          Severity: Major
                          Found in scripts/apps/monitoring/directives/AggregateSettings.ts - About 1 day to fix

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

                                render() {
                                    const padding = 20;
                                    const extraButtons = this.props.getExtraButtons?.() ?? null;
                            
                                    const query: ISuperdeskQuery = getQueryWithFilters(
                            Severity: Major
                            Found in scripts/core/ArticlesListByQueryWithFilters.tsx - About 1 day to fix

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

                                                      <div className="proofreading-panel-content__block">
                                                          <label className="proofreading-panel-content__label">
                                                              {gettext('Headline')}
                                                          </label>
                              
                              
                              scripts/apps/authoring-react/toolbar/proofreading-theme-panel.tsx on lines 162..192
                              scripts/apps/authoring-react/toolbar/proofreading-theme-panel.tsx on lines 194..224

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

                              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

                                                          <div className="image-block__metadata image-block__metadata--side-marg0">
                                                              <span>
                                                                  <em>{gettext('Credit:')}{' '}</em>
                                                                  {data.byline || gettext('[No Value]')}
                                                              </span>
                              Severity: Major
                              Found in scripts/core/editor3/components/media/MediaBlock.tsx and 1 other location - About 1 day to fix
                              scripts/core/editor3/components/media/MediaBlock.tsx on lines 267..287

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

                              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

                                                          <div className="image-block__metadata image-block__metadata--side-marg0">
                                                              <span>
                                                                  <em>{gettext('Credit:')}{' '}</em>
                                                                  {data.byline || gettext('[No Value]')}
                                                              </span>
                              Severity: Major
                              Found in scripts/core/editor3/components/media/MediaBlock.tsx and 1 other location - About 1 day to fix
                              scripts/core/editor3/components/media/MediaBlock.tsx on lines 227..247

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

                              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

                                                      <div className="proofreading-panel-content__block">
                                                          <label className="proofreading-panel-content__label">
                                                              {gettext('Body')}
                                                          </label>
                              
                              
                              scripts/apps/authoring-react/toolbar/proofreading-theme-panel.tsx on lines 132..160
                              scripts/apps/authoring-react/toolbar/proofreading-theme-panel.tsx on lines 162..192

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

                              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