concord-consortium/rigse

View on GitHub

Showing 1,197 of 2,136 total issues

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

  render () {
    const resourceName = this.props.resourceName;
    const license = this.props.license_info;
    const credits = this.props.credits;

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 renderTimeRequired has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  renderTimeRequired () {
    const resource = this.props.resource;
    const timeRequired = resource.material_type === "Activity"
      ? "45 Minutes"
      : resource.material_type === "Investigation"
Severity: Minor
Found in rails/react-components/src/library/components/stem-finder-result.tsx - 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 query has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  query (_params: any, _fieldName?: any) {
    const params = jQuery.extend({}, _params); // clone
    if (_fieldName) {
      this.setState({ [`waitingFor_${_fieldName}`]: true });
      params.load_only = _fieldName;

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 TextInputWithAsyncValidationSupport has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const TextInputWithAsyncValidationSupport = (props: any) => {
  const { asyncValidation, asyncValidationError, validations, ...innerProps } = props;
  const [asyncValidationPassed, setAsyncValidationPassed] = useState(true);

  // eslint-disable-next-line react-hooks/exhaustive-deps
Severity: Minor
Found in rails/react-components/src/library/components/signup/text_input.tsx - 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 render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  render () {
    const providerComponents = [];

    if (enableAuthProviders && this.props.oauthProviders) {
      const providers = this.props.oauthProviders;
Severity: Minor
Found in rails/react-components/src/library/components/signup/login_modal.tsx - 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 render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  render () {
    const { type, placeholder, disabled, name } = this.props;

    let className = "text-input " + this.props.name;
    if (this.props.showRequired && !this.props.isPristine) {
Severity: Minor
Found in rails/react-components/src/library/components/signup/text_input.tsx - 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

Avoid too many return statements within this function.
Open

                    return newToken( Type.OPERATOR, firstChar );
Severity: Major
Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                        return newToken( this.unitTypes[ match[0].toLowerCase() ] || Type.DIMEN, val );
    Severity: Major
    Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                              return newToken( Type.URL, match[2] || match[3] || match[4] || '' );
      Severity: Major
      Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                                return failure();
        Severity: Major
        Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                          return newToken( Type.IDENT, val );
          Severity: Major
          Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                        return newToken( Type.COLOR, this.css.substring( ch, this.ch ) );
            Severity: Major
            Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                                  return newToken( Type.FUNCTION, val );
              Severity: Major
              Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                    return newToken( Type.PERCENT, val + '%' );
                Severity: Major
                Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return newToken( Type.CHARACTER, firstChar );
                  Severity: Major
                  Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return newToken( Type.NUMBER, val );
                    Severity: Major
                    Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                          return newToken( Type.COLOR, val );
                      Severity: Major
                      Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return select( selector.replace( rtrim, "$1" ), context, results, seed );
                        Severity: Major
                        Found in rails/app/assets/javascripts/prototype.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return value;
                          Severity: Major
                          Found in rails/app/assets/javascripts/prototype.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return results;
                            Severity: Major
                            Found in rails/app/assets/javascripts/prototype.js - About 30 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language