Showing 173 of 964 total issues

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

    componentDidMount() {
        this.context.d2.models.program.list(
            {
                paging: false,
                fields: 'id,displayName,programTrackedEntityAttributes[id,displayName,trackedEntityAttribute],programIndicators[id,displayName,dimensionItem]',
Severity: Minor
Found in packages/expression-manager/src/ProgramOperandSelector.js - About 1 hr to fix

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

        render() {
            let icon;
            switch (this.props.type) {
                case SUCCESS:
                    icon = (

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

          render() {
              return (
                  <div style={styles.container}>
                      <div style={styles.title}>
                          {this.context.d2.i18n.getTranslation(
      Severity: Minor
      Found in packages/sharing-dialog/src/UserSearch.component.js - About 1 hr to fix

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

            render() {
                return (
                    <div>
                        <Card style={Object.assign({}, this.styles.card, { width: 250 })}>
                            <CardText style={this.styles.cardText}>
        Severity: Minor
        Found in examples/create-react-app/src/components/group-editor.js - About 1 hr to fix

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

              render() {
                  return (
                      <TreeView label="Persistent Root" persistent>
                          <TreeView label="Branch 1" initiallyExpanded>
                              <TreeView label="Sub-branch 1" initiallyExpanded>

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

                render() {
                    const {
                        profileItems,
                        notifications,
                        noLoadingIndicator } = this.props;
            Severity: Minor
            Found in packages/header-bar/src/HeaderBar.js - About 1 hr to fix

              Function renderSubscriptionButton has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  renderSubscriptionButton() {
                      const tOpts = { object: translateModelName(this.props.model.modelName) };
                      const [SubscriberIcon, subscriptionTooltip] = this.props.model.subscribed
                          ? [
                                SubscriberIconEnabled,
              Severity: Minor
              Found in packages/interpretations/src/components/DetailsPanel/Details.js - About 1 hr to fix

                Function fetchData has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

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

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

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

                    render() {
                        const itemsPerRow = this.props.rowItemCount;
                        const menuWidth = itemsPerRow * MENU_ITEM_WIDTH;
                        const { name, children } = this.props;
                        const menuStyle = Object.assign({}, styles.dropDownWrap, {
                Severity: Minor
                Found in packages/header-bar/src/menus/HeaderMenu.js - About 1 hr to fix

                  Function componentWillMount has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      componentWillMount() {
                          if (!this.props.expressionStatusStore) {
                              return true;
                          }
                  
                  
                  Severity: Minor
                  Found in packages/expression-manager/src/ExpressionManager.js - About 1 hr to fix

                    Function BiWeeklyPeriodType has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function BiWeeklyPeriodType(formatYyyyMmDd, fnFilter) {
                        this.generatePeriods = config => {
                            let periods = [];
                            const offset = parseInt(config.offset, 10);
                            const isFilter = config.filterFuturePeriods;

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

                          render() {
                              const { open } = this.props;
                      
                              return (
                                  <Dialog open={open} onClose={this.onRequestClose} maxWidth="md">
                      Severity: Minor
                      Found in packages/file-menu/src/WriteInterpretationDialog.js - About 1 hr to fix

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

                        function TwoPanelSelector(props) {
                            const { children, childWrapStyle, mainStyle, sizeRatio, ...otherProps } = props;
                            const mergedMainStyle = {
                                flex: 1,
                                display: 'flex',
                        Severity: Minor
                        Found in packages/core/src/layout/TwoPanel.component.js - About 1 hr to fix

                          Function UserOrgUnitsPanel has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const UserOrgUnitsPanel = props => {
                              return (
                                  <div style={styles.container}>
                                      <Grid
                                          container
                          Severity: Minor
                          Found in packages/org-unit-dialog/src/UserOrgUnitsPanel.js - About 1 hr to fix

                            Function generatePeriods has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                this.generatePeriods = config => {
                                    let periods = [];
                                    const offset = parseInt(config.offset, 10);
                                    const isFilter = config.filterFuturePeriods;
                                    const isReverse = config.reversePeriods;

                              Function renderActionButtons has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  renderActionButtons() {
                                      return (
                                          <DialogActions>
                                              <Button
                                                  color="primary"
                              Severity: Minor
                              Found in packages/translation-dialog/src/TranslationForm.component.js - About 1 hr to fix

                                Function withPropsFromObservable has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export default function withPropsFromObservable(observable, BaseComponent) {
                                    class WithPropsFromComponent extends Component {
                                        constructor(props, context) {
                                            super(props, context);
                                
                                
                                Severity: Minor
                                Found in packages/core/src/component-helpers/withPropsFromObservable.js - About 1 hr to fix

                                  Function getContent has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      getContent() {
                                          const {
                                              classes,
                                              currentInterpretationId,
                                              onCurrentInterpretationChange,

                                    Function parse has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    const parse = (code) => (state, silent) => {
                                        if (silent) return false;
                                    
                                        const start = state.pos;
                                    
                                    
                                    Severity: Minor
                                    Found in packages/rich-text/src/parser/MdParser.js - About 1 hr to fix

                                    Cognitive Complexity

                                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                    A method's cognitive complexity is based on a few simple rules:

                                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                    • Code is considered more complex for each "break in the linear flow of the code"
                                    • Code is considered more complex when "flow breaking structures are nested"

                                    Further reading

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

                                        renderLevel(level, isLastChild) {
                                            const styles = {
                                                leafNode: {},
                                                leafLabel: {
                                                    fontSize: 11,
                                    Severity: Minor
                                    Found in examples/create-react-app/src/components/tree-view/huge-tree.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language