superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

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

    render() {
        const props = this.props;

        if (props.item.state != null) {
            let title = getStateLabel(props.item.state);
Severity: Minor
Found in scripts/apps/search/components/fields/state.tsx - About 1 hr to fix

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

        function init() {
            if (!ready) {
                ready = $q.all({
                    ingestProvidersById: ingestSources.initialize().then(() => {
                        setState({ingestProvidersById: ingestSources.providersLookup});
    Severity: Minor
    Found in scripts/apps/search/services/MonitoringState.ts - About 1 hr to fix

      Function getItemsToLoad has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function getItemsToLoad<T>(
          loadedItems: Map<number, T>,
          totalItemsCount: number,
          viewportIndexStart: number,
          viewportIndexEnd: number,
      Severity: Minor
      Found in scripts/core/ui/components/virtual-lists/virtual-list.tsx - About 1 hr to fix

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

            render() {
                const spacing = this.props.padding ?? 10;
                const borderRadius = this.props.borderRadius ?? 4;
        
                return (
        Severity: Minor
        Found in scripts/core/ui/components/Card.tsx - About 1 hr to fix

          Function onKeyDown has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              onKeyDown(event) {
                  if (event) {
                      switch (event.keyCode) {
                      case KEYCODES.ENTER:
                          onEventCapture(event);

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

                render() {
                    const {error} = this.state;
            
                    return (
                        <form onSubmit={this.onSubmit} className="embed-dialog" onKeyUp={this.onKeyUp}>
            Severity: Minor
            Found in scripts/core/editor3/components/embeds/EmbedInput.tsx - About 1 hr to fix

              Function insertEntity has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function insertEntity(
                  editorState: EditorState,
                  draftEntityType,
                  mutability,
                  data,
              Severity: Minor
              Found in scripts/core/editor3/helpers/draftInsertEntity.ts - About 1 hr to fix

                Function createHighlight has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    createHighlight(type, h, highlightId) {
                        if (type === 'ANNOTATION') {
                            return (
                                <AnnotationPopup
                                    annotation={h}
                Severity: Minor
                Found in scripts/core/editor3/components/HighlightsPopup.tsx - About 1 hr to fix

                  Function BlockRendererComponent has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const BlockRendererComponent: React.StatelessComponent<any> = (props) => {
                      const {block, contentState} = props;
                      const entityKey = block.getEntityAt(0);
                  
                      if (!entityKey) {
                  Severity: Minor
                  Found in scripts/core/editor3/components/blockRenderer.tsx - About 1 hr to fix

                    Function showPrintableModal has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function showPrintableModal(
                        Component: React.ComponentType<IPropsPrintableModal>,
                    ) {
                        showModal(({closeModal}) => {
                            return (
                    Severity: Minor
                    Found in scripts/core/services/modalService.tsx - About 1 hr to fix

                      Function _http has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  _http: function(method, url, params, data) {
                                      var created;
                      
                                      var options: any = {
                                          method: method.toLowerCase(),
                      Severity: Minor
                      Found in scripts/core/services/server.ts - About 1 hr to fix

                        Function loadItems has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            loadItems(from, to): Promise<IRestApiResponse<any>> {
                                const pageSize = to - from;
                                const page = from === 0 ? 1 : Math.ceil(from / pageSize);
                        
                                const withPagination = {
                        Severity: Minor
                        Found in scripts/core/ArticlesListByQuery.tsx - About 1 hr to fix

                          Function storeValue has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              storeValue: (value, fieldId, rundownItem, config, fieldType) => {
                                  if (fieldType === 'editor3') {
                                      const editor3Config = config as IEditor3Config;
                                      const rawState = (value as IEditor3ValueStorage).rawContentState;
                          
                          

                            Function getMenuItems has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                getMenuItems(): Array<IMenuGroup> {
                                    const {gettext} = superdeskApi.localization;
                                    const filterActiveSets = (set: ISetItem) => (
                                        this.props.availableSetIds.includes(set._id)
                                    );
                            Severity: Minor
                            Found in scripts/extensions/sams/src/components/workspaceSubnav.tsx - About 1 hr to fix

                              Function handleRotateTransitionEnd has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  handleRotateTransitionEnd() {
                                      // avoid transition rerun after set scale
                                      if (this.hasTransitionRun === true || this.videoRef.current == null) {
                                          return;
                                      }
                              Severity: Minor
                              Found in scripts/extensions/videoEditor/src/VideoEditor.tsx - About 1 hr to fix

                                Function getTemplateEditViewAuthoringStorage has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function getTemplateEditViewAuthoringStorage(article: IArticle): IAuthoringStorage<IArticle> {
                                    class AutoSaveTemplate implements IAuthoringAutoSave<IArticle> {
                                        get() {
                                            return Promise.resolve(article);
                                        }

                                  Function getFieldV2 has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      getFieldV2: (fieldEditor, fieldSchema) => {
                                          const vocabulary = sdApi.vocabularies.getAll().get('urgency');
                                  
                                          // HAS TO BE SYNCED WITH styles/sass/labels.scss
                                          var defaultUrgencyColors = {
                                  Severity: Minor
                                  Found in scripts/apps/authoring-react/field-adapters/urgency.ts - About 1 hr to fix

                                    Function preview has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                                function preview(item) {
                                                    if (item) {
                                                        // for items from external source or if type is undefined.
                                                        if (item._type === 'externalsource') {
                                                            select(item);
                                    Severity: Minor
                                    Found in scripts/apps/monitoring/directives/MonitoringGroup.ts - About 1 hr to fix

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

                                              link: function(scope) {
                                                  var currFilter;
                                      
                                                  function init() {
                                                      scope.matchingFilters = []; // used for filter search
                                      Severity: Minor
                                      Found in scripts/apps/ingest/directives/IngestRoutingFilter.ts - About 1 hr to fix

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

                                                link: function($scope, elem, attrs) {
                                                    function getMenuGroups() {
                                                        let intent: any = {};
                                        
                                                        if (_.get(attrs, 'sdIntentType')) {
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language