superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

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

    render() {
        const {languages, item, update} = this.props;

        return (
            <div>
Severity: Minor
Found in scripts/apps/vocabularies/ManageVocabularyItemTranslations.tsx - About 1 hr to fix

    Function TemplateEditorModal has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function TemplateEditorModal() {
        return {
            templateUrl: 'scripts/apps/templates/views/template-editor-modal.html',
            link: function(scope) {
                let _isDirty;
    Severity: Minor
    Found in scripts/apps/templates/directives/TemplateEditorModal.ts - About 1 hr to fix

      Function ResendItem has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function ResendItem(subscribersService, authoring, api, notify) {
          return {
              templateUrl: 'scripts/apps/archive/views/resend-configuration.html',
              scope: {item: '='},
              link: function(scope, elem, attr) {
      Severity: Minor
      Found in scripts/apps/archive/directives/ResendItem.ts - About 1 hr to fix

        Function init has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            init() {
                // Initialize required data
                if (this.scope.markField === 'marked_desks') {
                    this.scope.deskMarking = true;
                    this.scope.service = this.desks;
        Severity: Minor
        Found in scripts/apps/archive/directives/MarkedItemTitle.ts - About 1 hr to fix

          Function CommentsCtrl has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function CommentsCtrl($scope, $routeParams, commentsService) {
              $scope.text = null;
              $scope.saveEnterFlag = false;
              $scope.$watch('item._id', reload);
              $scope.users = [];
          Severity: Minor
          Found in scripts/apps/authoring/comments/comments.ts - About 1 hr to fix

            Function saveAreaOfInterest has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                $scope.saveAreaOfInterest = function(croppingData) {
                    const [width, height] = [
                        croppingData.CropRight - croppingData.CropLeft,
                        croppingData.CropBottom - croppingData.CropTop,
                    ];

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

                  render() {
                      const {item, itemSelected, isLocked, getActionsMenu, multiSelect} = this.props;
              
                      const swimlaneViewFieldsConfig = appConfig.swimlaneViewFields ?? DEFAULT_SWIMLANE_FIELDS_CONFIG;
              
              
              Severity: Minor
              Found in scripts/apps/search/components/ItemSwimlane.tsx - About 1 hr to fix

                Function getNested has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        const getNested = () => {
                            switch (this.props.view) {
                            case 'swimlane2':
                            case 'mgrid':
                            case 'photogrid':
                Severity: Minor
                Found in scripts/apps/search/components/Item.tsx - About 1 hr to fix

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

                      render() {
                          const {desks} = this;
                          const markedDesksById = this.props.markedDesksById || {};
                  
                          return (
                  Severity: Minor
                  Found in scripts/apps/search/components/MarkedDesksList.tsx - About 1 hr to fix

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

                        render() {
                            const {items} = this.state;
                    
                            if (items == null) {
                                return null;
                    Severity: Minor
                    Found in scripts/core/itemList/items-list-limited.tsx - About 1 hr to fix

                      Function toPyEveFilter has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function toPyEveFilter(q: ILogicalOperator | IComparison) {
                          if (isLogicalOperator(q)) {
                              const r = {};
                      
                              if (q['$and'] != null) {
                      Severity: Minor
                      Found in scripts/core/query-formatting.ts - About 1 hr to fix

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

                            render() {
                                if (this.props.previewOutput) {
                                    return (
                                        <div
                                            data-test-id={`gform-output--${this.props.formField.field}`}
                        Severity: Minor
                        Found in scripts/core/ui/components/generic-form/input-types/duration.tsx - About 1 hr to fix

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

                                  link: function(scope) {
                                      scope.selectedItems = [];
                          
                                      // use listCopy in order not to mutate the original list
                                      // mutating the original list prevents passing expression as a list argument
                          Severity: Minor
                          Found in scripts/core/ui/ui.ts - About 1 hr to fix

                            Function getGenericHttpEntityListPageComponent has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const getGenericHttpEntityListPageComponent = <T extends IBaseRestApiResponse, P>(
                                resource: string,
                                formConfig: IFormGroup,
                                defaultSortOption?: ISortOption,
                                additionalProps?: P,
                            Severity: Minor
                            Found in scripts/core/ui/components/ListPage/generic-list-page.tsx - About 1 hr to fix

                              Function ActivityService has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      function ActivityService($location, $injector, $q, modal, _) {
                                          var activityStack = [];
                              
                                          this.activityStack = activityStack;
                              
                              
                              Severity: Minor
                              Found in scripts/core/activity/activity.ts - About 1 hr to fix

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

                                    render() {
                                        const embed = this.data();
                                        const html = embed.data.html;
                                        const isQumu = isQumuWidget(html);
                                        const {readOnly} = this.props;
                                Severity: Minor
                                Found in scripts/core/editor3/components/embeds/EmbedBlock.tsx - About 1 hr to fix

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

                                  export const SubHeader: React.StatelessComponent<any> = ({children, className}) => (
                                      <div
                                          className={classNames(
                                              'side-panel__header side-panel__header--border-b',
                                              className,
                                  Severity: Major
                                  Found in scripts/core/ui/components/SidePanel/SubHeader.tsx and 3 other locations - About 1 hr to fix
                                  scripts/core/ui/components/Dropdown/Label.tsx on lines 11..20
                                  scripts/core/ui/components/Preview/Panel.tsx on lines 10..19
                                  scripts/core/ui/components/SidePanel/Footer.tsx on lines 10..19

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

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

                                      constructor(props: IProps) {
                                          super(props);
                                  
                                          this.doPreview = this.doPreview.bind(this);
                                          this.doEdit = this.doEdit.bind(this);
                                  scripts/apps/authoring-react/article-widgets/suggestions.tsx on lines 143..148
                                  scripts/apps/authoring-react/toolbar/mark-for-desks/mark-for-desks-popover.tsx on lines 15..20
                                  scripts/apps/search/components/fields/translations.tsx on lines 12..17

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

                                  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.selectProvider = function(selectId, provider) {
                                              element(by.id(selectId)).element(by.css('option[label="' + provider + '"]')).click();
                                          };
                                  Severity: Major
                                  Found in e2e/client/specs/helpers/search.ts and 2 other locations - About 1 hr to fix
                                  e2e/client/specs/helpers/search.ts on lines 423..425
                                  e2e/client/specs/helpers/search.ts on lines 451..453

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

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

                                      constructor(props: IProps) {
                                          super(props);
                                  
                                          this.unMarkDesks = this.unMarkDesks.bind(this);
                                          this.getSelectedDeskIds = this.getSelectedDeskIds.bind(this);
                                  scripts/apps/authoring-react/article-widgets/suggestions.tsx on lines 143..148
                                  scripts/apps/search/components/fields/translations.tsx on lines 12..17
                                  scripts/extensions/broadcasting/src/rundowns/rundowns-list.tsx on lines 73..78

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

                                  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