superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

Function ItemContainer has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const ItemContainer: React.StatelessComponent<any> = (props) => {
    const item = props.item;
    const desk = props.desk || null;
    let label;
    let value;
Severity: Minor
Found in scripts/apps/search/components/ItemContainer.tsx - About 1 hr to fix

    Function maybeDisplayInvalidInstanceConfigurationMessage has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function maybeDisplayInvalidInstanceConfigurationMessage() {
        const issues: Array<React.ReactNode> = [];
    
        ng.get('vocabularies').getAllActiveVocabularies().then((vocabularies) => {
            const categoriesMissing = vocabularies.find(({_id}) => _id === 'categories') == null;
    Severity: Minor
    Found in scripts/validate-instance-configuration.tsx - About 1 hr to fix

      Function save has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          $scope.save = (close) => {
              const imagesForSaving = angular.copy($scope.images);
      
              imagesForSaving.forEach((image) => {
                  delete image.selected;
      Severity: Minor
      Found in scripts/apps/search/MultiImageEdit.ts - About 1 hr to fix

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

                link: function(scope: IScope) {
                    const getDefaults = (): IModel => ({
                        everyDay: 'true',
                        customWeekdays: [],
                        everyHour: 'true',
        Severity: Minor
        Found in scripts/apps/search/directives/EditTimeInterval.ts - About 1 hr to fix

          Function setProcessedItems has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                              var setProcessedItems = () => {
                                  if (scope.loading) {
                                      return;
                                  }
          
          
          Severity: Minor
          Found in scripts/core/itemList/itemList.ts - About 1 hr to fix

            Function canAddHighlight has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function canAddHighlight(editorState, highlightType) {
                if (highlightTypeValid(highlightType) !== true) {
                    return false;
                }
            
            
            Severity: Minor
            Found in scripts/core/editor3/helpers/highlights.ts - About 1 hr to fix

              Function startEditing has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  startEditing(id: string) {
                      if (this.state.editItem != null) {
                          this.modal.alert({
                              headerText: gettext('Warning'),
                              bodyText: gettext(
              Severity: Minor
              Found in scripts/core/ui/components/ListPage/generic-list-page.tsx - About 1 hr to fix

                Function canAddArticleEmbed has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function canAddArticleEmbed(
                    srcId: IArticle['_id'],
                    destId: IArticle['_id'],
                ): Promise<{ok: true; src: IArticle} | {ok: false; error: string}> {
                    return Promise.all([

                  Function getComponentForKey has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      getComponentForKey(key: string) {
                          const decorations: Array<string | null> = JSON.parse(key);
                  
                          return (props) => {
                              const {decoratorProps, ...compositionProps} = props;
                  Severity: Minor
                  Found in scripts/core/editor3/store/composite-decorator-custom.tsx - About 1 hr to fix

                    Function getAbbreviationText has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const getAbbreviationText = (block, offset) => {
                        const text = block.getText();
                        const length = block.getLength();
                        let start = offset;
                        let end = offset;
                    Severity: Minor
                    Found in scripts/core/editor3/reducers/editor3.tsx - About 1 hr to fix

                      Function confirmBase has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              function confirmBase(
                                  bodyText,
                                  headerText,
                                  okText,
                                  cancelText,
                      Severity: Minor
                      Found in scripts/core/services/modalService.tsx - About 1 hr to fix

                        Function reload has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            this.reload = function() {
                                var criteria = {
                                    where: getFilter(),
                                    embedded: {
                                        item: 1,
                        Severity: Minor
                        Found in scripts/core/menu/notifications/notifications.ts - About 1 hr to fix

                          Function constructor has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              constructor() {
                                  this.btnSave = $('.action-bar').element(by.buttonText('Save'));
                                  this.btnCancel = $('.action-bar').element(by.buttonText('Cancel'));
                          
                                  // the Preferences tab
                          Severity: Minor
                          Found in e2e/client/specs/helpers/user_prefs.ts - About 1 hr to fix

                            Function PublishQueueController has 8 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            export function PublishQueueController($scope, subscribersService, api, $q, notify, $location, ingestSources,
                                vocabularies) {
                            Severity: Major
                            Found in scripts/apps/publish/controllers/PublishQueueController.ts - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                          if (
                                              type == null // if `dropEvent` is defined, `type` can't be null
                                              || (
                                                  (config.allowPicture !== true && type === SUPERDESK_MEDIA_TYPES.PICTURE)
                                                  || (config.allowVideo !== true && type === SUPERDESK_MEDIA_TYPES.VIDEO)
                              Severity: Major
                              Found in scripts/apps/authoring-react/fields/media/editor.tsx - About 1 hr to fix

                                Consider simplifying this complex logical expression.
                                Open

                                                        if (data && (data.item || data.items || data.item_id) && scope.showRefresh && !data.force) {
                                                            // if we know the ids of the items then try to fetch those only
                                                            originalQuery = angular.extend({}, criteria.source.query);
                                
                                                            let items = data.items || {};
                                Severity: Major
                                Found in scripts/apps/monitoring/directives/MonitoringGroup.ts - About 1 hr to fix

                                  Function ContactEditorDirective has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      contacts,
                                      notify,
                                      privileges,
                                      metadata,
                                      $filter,
                                  Severity: Major
                                  Found in scripts/apps/contacts/directives/ContactEditorDirective.ts - About 1 hr to fix

                                    Function spikeActivity has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    function spikeActivity(data, modal, $location, multi,
                                        authoringWorkspace: AuthoringWorkspaceService, confirm, autosave, $rootScope) {
                                    Severity: Major
                                    Found in scripts/apps/archive/index.tsx - About 1 hr to fix

                                      Function DuplicateController has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                      export function DuplicateController(api, notify, $rootScope, data, desks, $location, workspaces, session) {
                                      Severity: Major
                                      Found in scripts/apps/archive/controllers/DuplicateController.ts - About 1 hr to fix

                                        Function ProductsConfigController has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                        export function ProductsConfigController($scope: IScope, notify, api, products, modal,
                                            subscribersService, metadata, $filter) {
                                        Severity: Major
                                        Found in scripts/apps/products/controllers/ProductsConfigController.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language