superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

Function ContentService has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

export function ContentService(api, templates, desks, packages: IPackagesService, archiveService, notify,
    $filter, $q, $rootScope, session, renditions) {
Severity: Major
Found in scripts/apps/workspace/content/services/ContentService.ts - About 1 hr to fix

    Function getInitialState has 11 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        item: {saved: T; autosaved: T},
        profile: IContentProfileV2,
        userPreferencesForFields: IStateLoaded<T>['userPreferencesForFields'],
        spellcheckerEnabled: boolean,
        fieldsAdapter: IFieldsAdapter<T>,
    Severity: Major
    Found in scripts/apps/authoring-react/authoring-react.tsx - About 1 hr to fix

      Function MonitoringView has 11 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          $rootScope,
          authoringWorkspace: AuthoringWorkspaceService,
          pageTitle,
          $timeout,
          $location,
      Severity: Major
      Found in scripts/apps/monitoring/directives/MonitoringView.ts - About 1 hr to fix

        Function MonitoringGroup has 11 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            cards,
            api,
            authoringWorkspace: AuthoringWorkspaceService,
            $timeout,
            superdesk,
        Severity: Major
        Found in scripts/apps/monitoring/directives/MonitoringGroup.ts - About 1 hr to fix

          Function AuthoringHeaderDirective has 11 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              api,
              authoringWidgets,
              $rootScope,
              archiveService,
              metadata,

            Function SearchParameters has 11 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            export function SearchParameters($location, asset, tags, metadata, common, desks,
                userList, ingestSources, subscribersService, $templateCache, search) {
            Severity: Major
            Found in scripts/apps/search/directives/SearchParameters.ts - About 1 hr to fix

              Function registerExtensions has 11 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  extensionLoaders: Array<IExtensionLoader>,
                  superdesk,
                  modal,
                  privileges,
                  lock,
              Severity: Major
              Found in scripts/core/register-extensions.tsx - About 1 hr to fix

                Function exports has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                module.exports = function(grunt) {
                    var webpackConfig = makeConfig(grunt);
                
                    return {
                        options: {
                Severity: Minor
                Found in tasks/options/webpack-dev-server.js - About 1 hr to fix

                  Function _archive has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        this._archive = function (exp, id, locals, pass, description) {
                          var _initStores = this._initStores;
                          return function (newVal, oldVal) {
                            var watchObj;
                            _initStores(id);
                  Severity: Minor
                  Found in scripts/libs/angular-history/history.js - About 1 hr to fix

                    Function runAnalysis has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            runAnalysis() {
                                const dataBeforeLoading = this.state.data;
                    
                                this.setState({data: 'loading'}, () => {
                                    const {guid, language, headline, body_html, abstract} = this.props.article;
                    Severity: Minor
                    Found in scripts/extensions/auto-tagging-widget/src/auto-tagging.tsx - About 1 hr to fix

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

                          render() {
                              let classes = classNames('sd-searchbar', {
                                  [`sd-searchbar--${this.props.type}`]: this.props.type,
                                  'sd-searchbar--expanded': this.props.type === 'expanded' || this.props.type === undefined,
                                  'sd-searchbar--focused': this.props.focused,
                      Severity: Minor
                      Found in scripts/extensions/sams/src/ui/SearchBar.tsx - About 1 hr to fix

                        Function getAnnotationInputWithKnowledgeBase has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function getAnnotationInputWithKnowledgeBase(superdesk: ISuperdesk) {
                            class AnnotationInputWithKnowledgeBaseComponent
                                extends React.Component<IPropsAnnotationInputComponent & IPropsConnected> {
                                componentDidMount() {
                                    const {generateFilterForServer} = superdesk.forms;

                          Function prepareForDropping has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const prepareForDropping = (
                              event: React.DragEvent<HTMLDivElement>,
                              image: IImage | null,
                          ) => {
                              if (image == null) {

                            Function duplicateItems has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function duplicateItems(items: Array<IArticle>, destination: ISendToDestination): Promise<Array<IArticle>> {
                                return Promise.all(
                                    items.map((item) => {
                                        const payload = (() => {
                                            if (destination.type === 'personal-space') {
                            Severity: Minor
                            Found in scripts/api/article-duplicate.tsx - About 1 hr to fix

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

                                  constructor(props: IProps) {
                                      super(props);
                              
                                      if (this.props.original?._id == null) {
                                          this.state = {
                              Severity: Minor
                              Found in scripts/extensions/sams/src/components/sets/setEditorPanel.tsx - About 1 hr to fix

                                Function getArticleAdapter has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function getArticleAdapter(): IAuthoringReactArticleAdapter {
                                    const customFieldVocabularies = getCustomFieldVocabularies();
                                
                                    const oldFormatCustomFieldIds: Set<IOldCustomFieldId> = new Set(
                                        customFieldVocabularies
                                Severity: Minor
                                Found in scripts/apps/authoring-react/article-adapter.ts - About 1 hr to fix

                                  Function initialize has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      initialize() {
                                          Promise.all([
                                              httpRequestJsonLocal<IRestApiResponse<IArticle>>({
                                                  method: 'GET',
                                                  path: `/archive/${this.props.article._id}?version=all`,

                                    Function applyMiddleware has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export function applyMiddleware(_item: IArticle): Promise<IArticle> {
                                        // Custom field types with `onTemplateCreate` defined. From all extensions.
                                        const fieldTypes: {[id: string]: ICustomFieldType<any, any, any, any>} = {};
                                    
                                        Object.values(extensions).forEach((ext) => {
                                    Severity: Minor
                                    Found in scripts/apps/authoring-react/toolbar/template-helpers.ts - About 1 hr to fix

                                      Function toggleField has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          toggleField(fieldId: string) {
                                              if (!this.state.initialized) {
                                                  return;
                                              }
                                      
                                      
                                      Severity: Minor
                                      Found in scripts/apps/authoring-react/authoring-react.tsx - About 1 hr to fix

                                        Function scheduleIfShouldUpdate has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                    function scheduleIfShouldUpdate(event, data) {
                                                        if (data && data.from_stage && data.from_stage === scope.group._id) {
                                                            // item was moved from current stage
                                                            extendItem(data.item, {
                                                                gone: true,
                                        Severity: Minor
                                        Found in scripts/apps/monitoring/directives/MonitoringGroup.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language