superdesk/superdesk-client-core

View on GitHub

Showing 3,654 of 3,654 total issues

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

    getFieldV2: (fieldEditor, fieldSchema) => {
        const fieldConfig: IDropdownTreeConfig = {
            getItems: () => {
                const metadata = ng.get('metadata');

Severity: Minor
Found in scripts/apps/authoring-react/field-adapters/authors.tsx - About 1 hr to fix

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

                    function initTupleFields() {
                        $scope.fieldAliases = {};
                        $scope.fieldsNotSelected = {};
                        $scope.currentFeedingService = $scope.provider ? _.find($scope.feedingServices,
                            {feeding_service: $scope.provider.feeding_service}) : null;
    Severity: Minor
    Found in scripts/apps/ingest/directives/IngestSourcesContent.ts - About 1 hr to fix

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

              render() {
                  return (
                      <Modal
                          visible
                          zIndex={1050}
      Severity: Minor
      Found in scripts/apps/ingest/directives/authenticate-ingest-provider.tsx - About 1 hr to fix

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

            render() {
                const {value, dataList, label, readOnly, querySearch, initValue} = this.props;
                const listData = querySearch ? dataList : this.state.filteredDataList;
                const inputValue = initValue ? value : this.state.searchText || value || '';
        
        

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

              render() {
                  const {
                      onClose,
                      target,
                      dataList,

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

                        scope.searchTerms = function(term) {
                            if (!term) {
                                scope.terms = filterSelected(scope.list);
                                scope.activeList = false;
                            } else {
            Severity: Minor
            Found in scripts/apps/authoring/metadata/metadata.ts - About 1 hr to fix

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

                      link: function(scope) {
                          var _orig;
              
                          scope.task = null;
                          scope.task_details = null;
              Severity: Minor
              Found in scripts/apps/dashboard/workspace-tasks/tasks.ts - About 1 hr to fix

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

                    render() {
                        return (
                            <div className="sd-board" >
                                <div
                                    className={'sd-board__header' + (this.props.onDeskSelect ? ' sd-board__header--clickable' : '')}
                Severity: Minor
                Found in scripts/apps/master-desk/components/CardComponent.tsx - About 1 hr to fix

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

                      componentDidMount() {
                          this.fetchAndShowActiveMessages();
                  
                          this.eventListenersToRemove.push(
                              addWebsocketEventListener(
                  Severity: Minor
                  Found in scripts/apps/system-messages/components/system-messages.tsx - About 1 hr to fix

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

                                function SearchContainerController($scope, $location, pageTitle, preferencesService) {
                                    const query = omit($location.search(), '_id', 'repo');
                    
                                    this.flags = $scope.flags || {};
                                    this.flags.facets = !isEmpty(query);
                    Severity: Minor
                    Found in scripts/apps/search/directives/SearchContainer.ts - About 1 hr to fix

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

                          render() {
                              const {noBorder, noPadding, grow, justifyContent, ellipsisAndGrow, children, bold = false, title} = this.props;
                              const cssClasses = [];
                              var styles: CSSProperties = {};
                      
                      
                      Severity: Minor
                      Found in scripts/core/components/ListItem.tsx - About 1 hr to fix

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

                            onSubmit() {
                                const {body, type} = this.state;
                                const _hidePopups = this.props.hidePopups;
                                const {highlightId} = this.props.data;
                        
                        
                        Severity: Minor
                        Found in scripts/core/editor3/components/annotations/AnnotationInput.tsx - About 1 hr to fix

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

                              handleBeforeInput(chars: string, editorState: EditorState) {
                                  this.setState({contentChangesAfterLastFocus: this.state.contentChangesAfterLastFocus + 1});
                          
                                  const author = getCurrentAuthor();
                                  const {onChange, suggestingMode, onCreateAddSuggestion} = this.props;
                          Severity: Minor
                          Found in scripts/core/editor3/components/Editor3Component.tsx - About 1 hr to fix

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

                            const setDeleteSuggestionForCharacter = (editorState, data) => {
                                const selection = editorState.getSelection();
                            
                                const paragraphStyle = Highlights.getHighlightStyleAtOffset(editorState, paragraphSuggestionTypes, selection, -1);
                            
                            
                            Severity: Minor
                            Found in scripts/core/editor3/reducers/suggestions.tsx - About 1 hr to fix

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

                              export const processCells = (state, fn) => {
                                  const {activeCell, editorState} = state;
                              
                                  if (activeCell === null) {
                                      return state;
                              Severity: Minor
                              Found in scripts/core/editor3/reducers/table.tsx - About 1 hr to fix

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

                                function getNextPosition(originalElement, editorNode) {
                                    const element = originalElement.cloneNode(true) as HTMLElement;
                                    const mainFlexElement = element.firstElementChild as HTMLElement;
                                
                                    originalElement.insertAdjacentElement('beforebegin', element);
                                Severity: Minor
                                Found in scripts/core/editor3/components/HighlightsPopupPositioner.tsx - About 1 hr to fix

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

                                  function TimeoutInterceptor($timeout, $q, $rootScope, request) {
                                      var TIMEOUT = 3000,
                                          TIMEOUT_MAX = 60000,
                                          STATUS = {
                                              OK: 0,
                                  Severity: Minor
                                  Found in scripts/core/api/timeout-interceptor.ts - About 1 hr to fix

                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                        setParentNode(node) {
                                            if (node && node.parentNode) {
                                                this.dom.parent = node.parentNode;
                                            } else {
                                                this.dom.parent = null;
                                    Severity: Major
                                    Found in scripts/apps/contacts/components/Popup/Popup.tsx and 1 other location - About 1 hr to fix
                                    scripts/core/ui/components/Popup/Popup.tsx on lines 127..133

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

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

                                        constructor(props: IProps) {
                                            super(props);
                                    
                                            this.state = {
                                                initialized: false,
                                    Severity: Major
                                    Found in scripts/core/ArticlesListByQuery.tsx and 4 other locations - About 1 hr to fix
                                    scripts/apps/authoring-react/toolbar/export-modal.tsx on lines 27..35
                                    scripts/apps/authoring-react/toolbar/highlights-management.tsx on lines 27..35
                                    scripts/apps/authoring-react/toolbar/highlights-modal.tsx on lines 29..37
                                    scripts/extensions/sams/src/components/attachments/samsAttachmentsList.tsx on lines 54..62

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

                                    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

                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                        setParentNode(node) {
                                            if (node && node.parentNode) {
                                                this.dom.parent = node.parentNode;
                                            } else {
                                                this.dom.parent = null;
                                    Severity: Major
                                    Found in scripts/core/ui/components/Popup/Popup.tsx and 1 other location - About 1 hr to fix
                                    scripts/apps/contacts/components/Popup/Popup.tsx on lines 126..132

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

                                    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