Showing 173 of 964 total issues

Function TreeViewExample has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const TreeViewExample = () => {
    const styles = {
        card: {
            margin: 16,
            width: 250,
Severity: Major
Found in examples/create-react-app/src/components/tree-view.js - About 3 hrs to fix

    Function EnhancedTable has 76 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const EnhancedTable = props => {
        const {
            data,
            rowsPerPage,
            totalRecords,
    Severity: Major
    Found in packages/favorites-dialog/src/EnhancedTable.js - About 3 hrs to fix

      Function getSideBarConfig has 76 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function getSideBarConfig() {
          return {
              all: {
                  items: [],
              },

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

            render() {
                const styles = {
                    card: {
                        margin: 16,
                        width: 370,
        Severity: Major
        Found in examples/create-react-app/src/components/period-picker.js - About 2 hrs to fix

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

              render() {
                  const {
                      classes,
                      createdByValue,
                      searchValue,
          Severity: Major
          Found in packages/favorites-dialog/src/EnhancedToolbar.js - About 2 hrs to fix

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

                render() {
                    const years = this.getYears();
            
                    return (
                        <div className="options-area">
            Severity: Major
            Found in packages/period-selector-dialog/src/FixedPeriodFilter.js - About 2 hrs to fix

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

                  render() {
                      const isDescriptionValid = () => this.state.description && this.state.description.trim();
              
                      return (
                          <Column>
              Severity: Major
              Found in packages/expression-manager/src/ExpressionManager.js - About 2 hrs to fix

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

                    constructor(props) {
                        super(props);
                
                        props.d2.i18n.translations['start_value'] = 'start value';
                        props.d2.i18n.translations['end_value'] = 'end value';
                Severity: Major
                Found in examples/create-react-app/src/components/legend.js - About 2 hrs to fix

                  Function subscribeDataElementActionsToStore has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function subscribeDataElementActionsToStore(dataElementOperandSelectorActions, dataElementOperandStore) {
                      const loadListSubscription = dataElementOperandSelectorActions.loadList.subscribe(() => {
                          getInstance()
                              .then(d2 => d2.Api.getApi().get('dataElementOperands', { fields: 'id,displayName', totals: true, filter: ['dataElement.domainType:eq:AGGREGATE'] }))
                              .then(createFakePager)
                  Severity: Major
                  Found in packages/expression-manager/src/dataElementOperandSelector.actions.js - About 2 hrs to fix

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

                        render() {
                            const { classes, placeholderText, suggestions, searchText } = this.props;
                    
                            return (
                                <div className={classes.root}>
                    Severity: Major
                    Found in packages/sharing-dialog/src/AutoComplete.component.js - About 2 hrs to fix

                      File PeriodPicker.component.js has 279 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import React from 'react';
                      import PropTypes from 'prop-types';
                      import log from 'loglevel';
                      import SelectField from 'material-ui/SelectField';
                      import MenuItem from 'material-ui/MenuItem';
                      Severity: Minor
                      Found in packages/core/src/period-picker/PeriodPicker.component.js - About 2 hrs to fix

                        File svg-icon.js has 278 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import React from 'react';
                        import { SvgIcon } from '@dhis2/d2-ui-core';
                        
                        const style = {
                            margin: 16,
                        Severity: Minor
                        Found in examples/create-react-app/src/components/svg-icon.js - About 2 hrs to fix

                          Interpretation has 24 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          export class Interpretation extends React.Component {
                              constructor(props) {
                                  super(props);
                                  this.notifyChange = this.notifyChange.bind(this);
                                  this.onSaveInterpretation = this.onSaveInterpretation.bind(this);

                            File OrgUnitSelector.js has 272 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import React, { Component, Fragment } from 'react';
                            import { OrgUnitTreeMultipleRoots } from '@dhis2/d2-ui-org-unit-tree';
                            import i18n from '@dhis2/d2-i18n';
                            import PropTypes from 'prop-types';
                            
                            
                            Severity: Minor
                            Found in packages/org-unit-dialog/src/OrgUnitSelector.js - About 2 hrs to fix

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

                                  render() {
                                      const currentOu = this.props.root;
                                      const hasChildren = this.hasChildren();
                                      const isSelectable = !!this.props.onSelectClick;
                                      const pathRegEx = new RegExp(`/${currentOu.id}$`);
                              Severity: Major
                              Found in packages/org-unit-tree/src/OrgUnitTree.component.js - About 2 hrs to fix

                                NewInterpretationField has 23 functions (exceeds 20 allowed). Consider refactoring.
                                Open

                                export class NewInterpretationField extends Component {
                                    constructor(props) {
                                        super(props);
                                        this.textarea = React.createRef();
                                        this.id = Math.random().toString(36);

                                  Function fetchData has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export const fetchData = () => {
                                      return (dispatch, getState) => {
                                          const state = getState();
                                  
                                          dispatch(toggleLoading());
                                  Severity: Major
                                  Found in packages/favorites-dialog/src/actions/index.js - About 2 hrs to fix

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

                                        render() {
                                            const color = this.state.color;
                                    
                                            const styles = {
                                                wrapper: {
                                    Severity: Major
                                    Found in packages/legend/src/ColorPicker.component.js - About 2 hrs to fix

                                      Function getPeriod has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          getPeriod() {
                                              const week = this.props.periodType === 'BiWeekly' && this.state.biWeek 
                                                  ? biWeekToWeek(this.state.biWeek)
                                                  : this.state.week;
                                              const date = this.state.year && week && getFirstDateOfWeek(this.state.year, week);
                                      Severity: Major
                                      Found in packages/core/src/period-picker/PeriodPicker.component.js - About 2 hrs to fix

                                        File FormBuilder.component.js has 267 lines of code (exceeds 250 allowed). Consider refactoring.
                                        Open

                                        import React from 'react';
                                        import PropTypes from 'prop-types';
                                        import { isObject, get } from 'lodash';
                                        import AsyncValidatorRunner from './AsyncValidatorRunner';
                                        
                                        
                                        Severity: Minor
                                        Found in packages/forms/src/FormBuilder.component.js - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language