superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

Function MonitoringController has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

export function MonitoringController($rootScope, $scope, $location, desks, superdeskFlags,
    search, $filter, preferencesService, $q) {
Severity: Major
Found in scripts/apps/monitoring/controllers/MonitoringController.ts - About 1 hr to fix

    Function DesksFactory has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    export function DesksFactory($q, api, preferencesService, userList, notify,
        session, $filter, privileges, $rootScope) {
    Severity: Major
    Found in scripts/apps/desks/services/DesksFactory.ts - About 1 hr to fix

      Function VocabularyConfigController has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      export function VocabularyConfigController($scope: IScope, $route, $routeParams, vocabularies, $rootScope,
          api, notify, modal, session) {
      Severity: Major
      Found in scripts/apps/vocabularies/controllers/VocabularyConfigController.ts - About 1 hr to fix

        Function SearchMenuController has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            $rootScope, $scope, $filter, $location, $route, searchProviderService, api, savedSearch,
            privileges,
        Severity: Major
        Found in scripts/apps/search/controllers/SearchMenuController.ts - About 1 hr to fix

          Function tagListItem has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      const tagListItem = (node: ITreeNode<ITagUi>) => {
                          const isRootNodeWithChildren = node.parent == null && node.children != null;
                          const item = node.value;
          
                          return (
          Severity: Minor
          Found in scripts/extensions/auto-tagging-widget/src/tag-list.tsx - About 1 hr to fix

            Function getFields has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function getFields(superdesk: ISuperdesk) {
                const {gettext} = superdesk.localization;
                const {FormFieldType} = superdesk.forms;
            
                const nameField: IFormField = {
            Severity: Minor
            Found in scripts/extensions/annotationsLibrary/src/GetFields.ts - About 1 hr to fix

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

                  render() {
                      return (
                          <LayoutContainer>
                              {this.props.header && (
                                  <HeaderPanel>
              Severity: Minor
              Found in scripts/extensions/sams/src/containers/PageLayout.tsx - About 1 hr to fix

                Function getAssetStateLabel has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function getAssetStateLabel(assetState: ASSET_STATE) {
                    const {gettext} = superdeskApi.localization;
                
                    switch (assetState) {
                    case ASSET_STATE.INTERNAL:
                Severity: Minor
                Found in scripts/extensions/sams/src/utils/ui.tsx - About 1 hr to fix

                  Function showSelectAssetModal has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      showSelectAssetModal() {
                          this.props.pushSearchParams({
                              sizeTo: superdeskApi.instance.config.attachments_max_size / 1048576, // bytes -> MB
                              states: [ASSET_STATE.PUBLIC, ASSET_STATE.INTERNAL],
                              setIds: this.props.activeSetIds,
                  Severity: Minor
                  Found in scripts/extensions/sams/src/apps/samsAttachmentsWidget.tsx - About 1 hr to fix

                    Function patch has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                = fieldsFlat.reduce((acc, field, index) => {
                                    let schemaPatch = {};
                                    let editorPatch: Partial<IContentProfileEditorConfig[0]> = {};
                    
                                    acc[field.id] = {

                      Function getOptions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function getOptions(
                          config: IDropdownConfigVocabulary,
                          getVocabularyOptions: (vocabularyId: IVocabulary['_id']) => Array<IVocabularyItem> = getOptionsDefault,
                      ): ITreeWithLookup<IDropdownOption> {
                          const vocabularyItems: Array<IVocabularyItem> = getVocabularyOptions(config.vocabularyId);

                        Function getReadOnlyAndArchivedFrom has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            const getReadOnlyAndArchivedFrom = (): Array<ITopBarWidget<IArticle>> => {
                                const actions: Array<ITopBarWidget<IArticle>> = [];
                        
                                if (item._type === 'archived') {
                                    actions.push({
                        Severity: Minor
                        Found in scripts/apps/authoring-react/authoring-angular-integration.tsx - About 1 hr to fix

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

                              render() {
                                  const {value1, value2, config} = this.props;
                          
                                  const values1 = (() => {
                                      if (value1 == null) {

                            Function handleUnsavedChanges has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                handleUnsavedChanges(state: IStateLoaded<T>): Promise<T> {
                                    return new Promise((resolve, reject) => {
                                        if (!this.hasUnsavedChanges()) {
                                            resolve(state.itemOriginal);
                                            return;
                            Severity: Minor
                            Found in scripts/apps/authoring-react/authoring-react.tsx - About 1 hr to fix

                              Function getPackagesContentProfile has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function getPackagesContentProfile<T>(
                                  item: IArticle,
                                  fieldsAdapter: IFieldsAdapter<T>,
                              ): Promise<IContentProfileV2> {
                                  const headlineField: IAuthoringFieldV2 = {
                              Severity: Minor
                              Found in scripts/apps/authoring-react/data-layer.ts - About 1 hr to fix

                                Function getCommentsWidgetGeneric has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function getCommentsWidgetGeneric<T>(
                                    getComments: (entityId: string) => Promise<Array<IComment>>,
                                    addComment: (entityId: string, text: string) => Promise<void>,
                                    isAllowed: (entity: T) => boolean,
                                ) {
                                Severity: Minor
                                Found in scripts/apps/authoring-react/generic-widgets/comments/index.tsx - About 1 hr to fix

                                  Function setFilterType has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      this.setFilterType = function(filterType, filterValue, $event?) {
                                          if (filterType === 'contentProfile') {
                                              if (!this.activeFilters.contentProfile.includes(filterValue._id)) {
                                                  this.activeFilters.contentProfile.push(filterValue._id);
                                                  const tag = {'key': filterValue._id, 'label': gettext(filterValue.label)};
                                  Severity: Minor
                                  Found in scripts/apps/monitoring/controllers/AggregateCtrl.ts - About 1 hr to fix

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

                                        render() {
                                            const {profile, fieldsData, fieldPadding} = this.props;
                                            const allFields = profile.header.merge(profile.content);
                                    
                                            return (
                                    Severity: Minor
                                    Found in scripts/apps/authoring-react/preview-authoring-item.tsx - About 1 hr to fix

                                      Function IngestDashboardController has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export function IngestDashboardController($scope, ingestSources, preferencesService, notify) {
                                          $scope.items = [];
                                          $scope.dashboard_items = [];
                                      
                                          $scope.fetchItems = function() {
                                      Severity: Minor
                                      Found in scripts/apps/ingest/controllers/IngestDashboardController.ts - About 1 hr to fix

                                        Function getBaseFieldsAdapter has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export function getBaseFieldsAdapter(): IFieldsAdapter<IArticle> {
                                            const adapter: IFieldsAdapter<IArticle> = {
                                                abstract: abstract,
                                                anpa_category: anpa_category,
                                                anpa_take_key: anpa_take_key,
                                        Severity: Minor
                                        Found in scripts/apps/authoring-react/field-adapters/index.tsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language