superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

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

    render() {
        const highlights = this.props.highlights;
        const highlightsById = this.props.highlightsById || {};

        return (
Severity: Minor
Found in scripts/apps/search/components/HighlightsList.tsx - About 1 hr to fix

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

        render() {
            return (
                <div
                    role="button"
                    tabIndex={this.props.tabEnabled ? 0 : null}
    Severity: Minor
    Found in scripts/core/ui/components/CollapseBox.tsx - About 1 hr to fix

      Function componentDidMount has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          componentDidMount() {
              const {ids} = this.props;
      
              this.monitoringState.init().then(() => {
                  Promise.all(ids.map((id) => dataApi.findOne<IArticle>('search', id)))
      Severity: Minor
      Found in scripts/core/itemList/items-list-limited.tsx - About 1 hr to fix

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

            render() {
                const group: IFormGroup = this.props.formConfig;
        
                return (
                    <FormGroupWrapper group={group}>
        Severity: Minor
        Found in scripts/core/ui/components/generic-form/from-group.tsx - About 1 hr to fix

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

              render() {
                  const classNames = [
                      'sd-alert',
                      this.props.hollow ? 'sd-alert--hollow' : '',
                      getTypeClassName(this.props.type),
          Severity: Minor
          Found in scripts/core/ui/components/alert.tsx - About 1 hr to fix

            Function getContents has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    const getContents = () => {
                        if (this.props.crudManager._items.length === 0) {
                            if (Object.keys(activeFilters).length > 0) {
                                return (
                                    <ListItem noHover>
            Severity: Minor
            Found in scripts/core/ui/components/ListPage/generic-list-page.tsx - About 1 hr to fix

              Function URLResolver has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function URLResolver($http, $q, $log) {
                  var _links, baseUrl = appConfig.server.url;
              
                  /**
                   * Get url for given resource
              Severity: Minor
              Found in scripts/core/api/url-resolver-service.ts - About 1 hr to fix

                Function renderURL has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    renderURL() {
                        return (
                            <form
                                onSubmit={() => {
                                    this.onSubmit(linkTypes.href);
                Severity: Minor
                Found in scripts/core/editor3/components/links/LinkInput.tsx - About 1 hr to fix

                  Function controller has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              controller: ['$scope', function($scope) {
                                  $scope.hide = true;
                  
                                  this.activate = function(item) {
                                      $scope.active = item;
                  Severity: Minor
                  Found in scripts/core/directives/TypeaheadDirective.ts - About 1 hr to fix

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

                            ingest: {
                                PROVIDER_DASHBOARD_DEFAULTS: {
                                    show_log_messages: true,
                                    show_ingest_count: true,
                                    show_time: true,
                    Severity: Major
                    Found in superdesk.config.js and 1 other location - About 1 hr to fix
                    e2e/client/superdesk.config.js on lines 19..29

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 69.

                    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

                            ingest: {
                                PROVIDER_DASHBOARD_DEFAULTS: {
                                    show_log_messages: true,
                                    show_ingest_count: true,
                                    show_time: true,
                    Severity: Major
                    Found in e2e/client/superdesk.config.js and 1 other location - About 1 hr to fix
                    superdesk.config.js on lines 23..33

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

                    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

                                        height: parseInt(taStyle.getPropertyValue('border-top-width'), 10) +
                                                parseInt(taStyle.getPropertyValue('padding-top'), 10) +
                                                parseInt(taStyle.getPropertyValue('padding-bottom'), 10) +
                                                parseInt(taStyle.getPropertyValue('border-bottom-width'), 10),
                    Severity: Major
                    Found in scripts/core/ui/autoheight-directive.ts and 1 other location - About 1 hr to fix
                    scripts/core/ui/autoheight-directive.ts on lines 89..92

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

                    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

                            this.exportHighlightsConfirm = function() {
                                var btn = element(by.className('modal__footer')).element(by.buttonText('OK'));
                    
                                waitFor(btn, 500);
                                btn.click();
                    Severity: Major
                    Found in e2e/client/specs/helpers/highlights.ts and 1 other location - About 1 hr to fix
                    e2e/client/specs/helpers/highlights.ts on lines 229..234

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

                    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('Usage terms').toUpperCase()}
                                                inlineLabel
                                                type="text"
                                                value={usageterms}
                    scripts/apps/authoring-react/article-widgets/metadata/metadata.tsx on lines 426..437

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

                    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

                                    self.values.regions = _.sortBy(self.values.geographical_restrictions,
                                        (target) => target.value && target.value.toLowerCase() === 'all' ? '' : target.name,
                                    );
                    Severity: Major
                    Found in scripts/apps/authoring/metadata/metadata.ts and 1 other location - About 1 hr to fix
                    scripts/apps/authoring/metadata/metadata.ts on lines 1172..1174

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

                    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

                            this.saveTextHighlightsConfirm = function() {
                                var btn = element(by.className('modal__footer')).element(by.buttonText('Save'));
                    
                                waitFor(btn, 500);
                                btn.click();
                    Severity: Major
                    Found in e2e/client/specs/helpers/highlights.ts and 1 other location - About 1 hr to fix
                    e2e/client/specs/helpers/highlights.ts on lines 222..227

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

                    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

                                component: ({entity}) => (
                                    <LockInfo
                                        article={entity}
                                        unlock={() => {
                                            stealLock();
                    Severity: Major
                    Found in scripts/apps/authoring-react/multi-edit-modal.tsx and 1 other location - About 1 hr to fix
                    scripts/apps/authoring-react/authoring-angular-integration.tsx on lines 560..568

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

                    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 (publishSchedule) {
                                info = datetimeHelper.splitDateTime(publishSchedule, $scope.item.time_zone);
                                $scope.item.publish_schedule_date = info.date;
                                $scope.item.publish_schedule_time = info.time;
                            }
                    Severity: Major
                    Found in scripts/apps/authoring/metadata/metadata.ts and 1 other location - About 1 hr to fix
                    scripts/apps/authoring/metadata/metadata.ts on lines 205..209

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

                    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

                        const beforeSelection = selection.merge({
                            anchorOffset: selection.getStartOffset(),
                            anchorKey: selection.getStartKey(),
                            focusOffset: selection.getStartOffset(),
                            focusKey: selection.getStartKey(),
                    Severity: Major
                    Found in scripts/core/editor3/helpers/highlights.ts and 1 other location - About 1 hr to fix
                    scripts/core/editor3/helpers/highlights.ts on lines 961..967

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

                    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

                        const afterSelection = selection.merge({
                            anchorOffset: selection.getEndOffset(),
                            anchorKey: selection.getEndKey(),
                            focusOffset: selection.getEndOffset(),
                            focusKey: selection.getEndKey(),
                    Severity: Major
                    Found in scripts/core/editor3/helpers/highlights.ts and 1 other location - About 1 hr to fix
                    scripts/core/editor3/helpers/highlights.ts on lines 954..960

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

                    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