Showing 173 of 964 total issues

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

    render() {
        return (
            <div>
                <Card>
                    <CardText>
Severity: Minor
Found in examples/create-react-app/src/components/icon-picker.js - About 1 hr to fix

    Function renderFieldsFromFieldConfigs has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        renderFieldsFromFieldConfigs() {
            return this.props.fieldConfigs
                .filter(fieldConfig => fieldConfig.type)
                .map((fieldConfig) => {
                    const fieldValue = this.props.source && this.props.source[fieldConfig.name];
    Severity: Minor
    Found in packages/forms/src/Form.component.js - About 1 hr to fix

      Function setSearchValue has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function setSearchValue(searchValue) {
          const matchesSearchValue = filterByValue(searchValue.trim().toLowerCase().split(/\s+/));
      
          searchSourceStore$
              .take(1)
      Severity: Minor
      Found in packages/header-bar/src/search/search.stores.js - About 1 hr to fix

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

            render() {
                const { enabled, fileType, fileModel } = this.props;
        
                return (
                    <Fragment>
        Severity: Minor
        Found in packages/file-menu/src/WriteInterpretationMenuItem.js - About 1 hr to fix

          Function generatePeriods has 26 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 PeriodType has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            function PeriodType() {
                const monthNames = [
                    'January',
                    'February',
                    'March',
            Severity: Minor
            Found in packages/period-selector-dialog/src/modules/FixedPeriodsGenerator.js - About 55 mins 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 insertHelper has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            export const insertHelper = (TYPE, WITH_SPACE, currentInput, cursorStart, emoticon = null) => {
                switch (TYPE) {
                    case LINK:
                        return WITH_SPACE 
                            ? insertLinkWithSpace(currentInput, cursorStart) 
            Severity: Minor
            Found in packages/interpretations/src/markdown/helper.js - About 55 mins 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 haveWriteAccess has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            export const haveWriteAccess = (d2, userGroups, object) => {
                const { currentUser } = d2 || {};
            
                if (!object || !currentUser) {
                    return false;
            Severity: Minor
            Found in packages/interpretations/src/authorization/auth.js - About 55 mins 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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                render() {
                    const filterHeight = this.getFilterText().length > 0 ? 15 : 0;
                    const styles = {
                        container: {
                            display: 'flex',
            Severity: Minor
            Found in packages/group-editor/src/GroupEditor.component.js - About 55 mins 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 haveReadAccess has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            export const haveReadAccess = (d2, userGroups, object) => {
                const { currentUser } = d2 || {};
            
                if (!object || !currentUser) {
                    return false;
            Severity: Minor
            Found in packages/interpretations/src/authorization/auth.js - About 55 mins 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 MonthlyPeriodType has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            function MonthlyPeriodType(formatYyyyMmDd, monthNames, fnFilter) {
                const formatIso = date => {
                    const y = date.getFullYear();
                    let m = String(date.getMonth() + 1);
            
            
            Severity: Minor
            Found in packages/period-selector-dialog/src/modules/FixedPeriodsGenerator.js - About 45 mins 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 forEachOnPath has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            export const forEachOnPath = (root, path, op) => {
                op(root);
                if (
                    path.length > 0 &&
                    (Array.isArray(root.children) || root.children.size > 0)
            Severity: Minor
            Found in packages/org-unit-tree/src/utils.js - About 45 mins 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 renderHelpText has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                renderHelpText() {
                    if ((!this.props.fieldOptions || !this.props.fieldOptions.helpText) || this.props.errorMessage) {
                        return null;
                    }
            
            
            Severity: Minor
            Found in packages/forms/src/FormField.component.js - About 45 mins 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 extract has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            const extract = async ({ input, output }) => {
                const relativeInput = "./" + path.relative(process.cwd(), input);
                if (!checkDirectoryExists(input)) {
                    reporter.error(
                        `I18n source directory ${chalk.bold(relativeInput)} does not exist.`
            Severity: Minor
            Found in packages/interpretations/scripts/extract.js - About 45 mins 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 Button has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            const Button = ({ raised, fab, color, disabled, onClick, children, style, selector }) => {
                const className = createClassName('d2-ui-button', selector);
                let MuiButton;
            
                if (fab) { // Always raised
            Severity: Minor
            Found in packages/core/src/button/Button.js - About 45 mins 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 OrgUnitModelArrayElementValidator has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function OrgUnitModelArrayElementValidator(propValue, key, componentName, location, propFullName) {
            Severity: Minor
            Found in packages/org-unit-tree/src/OrgUnitTreeMultipleRoots.component.js - About 35 mins to fix

              Function orgUnitPathPropValidator has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  propValue,
                  key,
                  compName,
                  location,
                  propFullName
              Severity: Minor
              Found in packages/org-unit-tree/src/OrgUnitTree.component.js - About 35 mins to fix

                Function renderLabel has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    renderLabel(
                        isSelected,
                        isSelectable,
                        isInitiallyExpanded,
                        canBecomeCurrentRoot,
                Severity: Minor
                Found in packages/org-unit-tree/src/OrgUnitTree.component.js - About 35 mins 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 concatHelper has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                export const concatHelper = (TYPE, WITH_SPACE, currentInput, highlightedText, cursorStart, cursorEnd) => {
                    switch (TYPE) {
                        case LINK:
                            return WITH_SPACE 
                                ? concatLinkWithSpace(currentInput, highlightedText, cursorStart, cursorEnd) 
                Severity: Minor
                Found in packages/interpretations/src/markdown/helper.js - About 35 mins 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 PublicAccessValue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                const PublicAccessValue = ({ value }) => {
                    const metaData = value.substr(0, 2);
                    const data = value.substr(2, 2);
                    const other = value.substr(4, 4);
                
                
                Severity: Minor
                Found in packages/table/src/data-value/PublicAccessValue.component.js - About 35 mins 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

                Severity
                Category
                Status
                Source
                Language