superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

Function PackageItemPreview has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function PackageItemPreview(api, lock, superdesk, authoringWorkspace: AuthoringWorkspaceService, $sce,
    desks, vocabularies) {
    return {
        scope: {
            item: '=',
Severity: Major
Found in scripts/apps/packaging/directives/PackageItemPreview.ts - About 3 hrs to fix

    Function SearchTags has 88 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function SearchTags($location, tags, asset, metadata, desks, $rootScope) {
        return {
            scope: {
                urlParams: '=',
            },
    Severity: Major
    Found in scripts/apps/search/directives/SearchTags.ts - About 3 hrs to fix

      Function fetchData has 88 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          fetchData(pageToFetch: number, pageSize: number): Promise<IFetchedData<T, IToJoin>> {
              const query: ISuperdeskQuery = {
                  filter: this.props.query.filter,
                  fullTextSearch: this.props.query.fullTextSearch,
                  sort: this.props.query.sort,
      Severity: Major
      Found in scripts/core/ui/components/virtual-lists/virtual-list-from-query.tsx - About 3 hrs to fix

        Function DropdownFocus has 88 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function DropdownFocus(Keys) {
            return {
                require: 'dropdown',
                link: function(scope, elem, attrs, dropdown) {
                    scope.$watch(dropdown.isOpen, (isOpen) => {
        Severity: Major
        Found in scripts/core/ui/ui.ts - About 3 hrs to fix

          desksService has 29 functions (exceeds 20 allowed). Consider refactoring.
          Open

              var desksService = {
                  desks: null,
                  users: null,
                  stages: null,
                  deskLookup: {},
          Severity: Minor
          Found in scripts/apps/desks/services/DesksFactory.ts - About 3 hrs to fix

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

                componentDidUpdate(prevProps: IProps) {
                    if (this.props.action === 'view' && JSON.stringify(prevProps.article) !== JSON.stringify(this.props.article)) {
                        // eslint-disable-next-line react/no-did-update-set-state
                        this.setState({articleOriginal: undefined}, () => {
                            this.fetchArticleFromServer();
            Severity: Major
            Found in scripts/apps/authoring/authoring/authoring-topbar2-react.tsx and 1 other location - About 3 hrs to fix
            scripts/apps/authoring/authoring/authoring-topbar-react.tsx on lines 38..45

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

            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

                componentDidUpdate(prevProps: IProps) {
                    if (this.props.action === 'view' && JSON.stringify(prevProps.article) !== JSON.stringify(this.props.article)) {
                        // eslint-disable-next-line react/no-did-update-set-state
                        this.setState({articleOriginal: undefined}, () => {
                            this.fetchArticleFromServer();
            Severity: Major
            Found in scripts/apps/authoring/authoring/authoring-topbar-react.tsx and 1 other location - About 3 hrs to fix
            scripts/apps/authoring/authoring/authoring-topbar2-react.tsx on lines 41..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 105.

            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.keydown = function(evt) {
                            if (evt.which === ESC) {
                                evt.preventDefault();
                                scope.close();
                            } else if (evt.which === DOWN_ARROW && !scope.open) {
            Severity: Major
            Found in scripts/core/ui/ui.ts and 1 other location - About 3 hrs to fix
            scripts/core/ui/ui.ts on lines 571..580

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

            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.keydown = function(evt) {
                            if (evt.which === ESC) {
                                evt.preventDefault();
                                scope.close();
                            } else if (evt.which === DOWN_ARROW && !scope.open) {
            Severity: Major
            Found in scripts/core/ui/ui.ts and 1 other location - About 3 hrs to fix
            scripts/core/ui/ui.ts on lines 417..426

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

            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

                                        <Input
                                            label={gettext('Description')}
                                            type="text"
                                            value={show.description ?? ''}
                                            error={validationResults.description ?? undefined}
            Severity: Major
            Found in scripts/extensions/broadcasting/src/shows/create-show.tsx and 1 other location - About 3 hrs to fix
            scripts/extensions/broadcasting/src/shows/create-show.tsx on lines 94..104

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

            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

            class LinkFunction extends BaseSortBar {
                contentApiSearch: any;
            
                constructor(contentApiSearch, sort, scope, elem) {
                    super(scope, elem, sort);
            scripts/apps/legal-archive/directives/LegalItemSortbar.ts on lines 3..13

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

            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

            class LinkFunction extends BaseSortBar {
                legal: any;
            
                constructor(legal, sort, scope, elem) {
                    super(scope, elem, sort);
            Severity: Major
            Found in scripts/apps/legal-archive/directives/LegalItemSortbar.ts and 1 other location - About 3 hrs to fix
            scripts/apps/content-api/directives/ContentAPISortBarDirective.ts on lines 3..13

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

            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

                                        <Input
                                            label={gettext('Show name')}
                                            type="text"
                                            value={show.title ?? ''}
                                            error={validationResults.title ?? undefined}
            Severity: Major
            Found in scripts/extensions/broadcasting/src/shows/create-show.tsx and 1 other location - About 3 hrs to fix
            scripts/extensions/broadcasting/src/shows/create-show.tsx on lines 106..116

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

            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

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

                render() {
                    const {gettext} = superdeskApi.localization;
                    const {download} = superdeskApi.entities.attachment;
            
                    const containerClasses = classNames({
            Severity: Major
            Found in scripts/extensions/sams/src/apps/samsAttachmentsWidget.tsx - About 3 hrs to fix

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

                  render() {
                      return (
                          <AuthoringWidgetLayout
                              header={(
                                  <AuthoringWidgetHeading
              Severity: Major
              Found in scripts/apps/authoring-react/article-widgets/find-and-replace.tsx - About 3 hrs to fix

                Function ContentExpiry has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function ContentExpiry() {
                    return {
                        templateUrl: 'scripts/apps/desks/views/content-expiry.html',
                        scope: {
                            item: '=',
                Severity: Major
                Found in scripts/apps/desks/directives/ContentExpiry.ts - About 3 hrs to fix

                  Function Activities has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function Activities(superdesk, asset) {
                      superdesk
                          .activity('/users/', {
                              label: gettext('User Management'),
                              description: gettext('Find your colleagues'),
                  Severity: Major
                  Found in scripts/apps/users/config.ts - About 3 hrs to fix

                    Function HighlightsConfig has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function HighlightsConfig($scope, highlightsService, desks, api, notify, modal) {
                        highlightsService.get().then((items) => {
                            items._items = _.sortBy(items._items, (i) => i.name.toLowerCase());
                            $scope.configurations = items;
                        });
                    Severity: Major
                    Found in scripts/apps/highlights/controllers/HighlightsConfig.ts - About 3 hrs to fix

                      Function MetaLocatorsDirective has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

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

                            render() {
                                const {storage} = this.angularservices;
                                const isEmpty = !this.props.itemsList.length;
                        
                                if (this.props.loading) {
                        Severity: Major
                        Found in scripts/apps/search/components/ItemList.tsx - About 3 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language