fede-rodes/crae-apollo-heroku

View on GitHub

Showing 7 of 69 total issues

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

  render() {
    const { client, onPageChange } = this.props;
    const { view, email } = this.state;

    const loginLink = (
Severity: Major
Found in client/src/pages/signup-page/index.js - About 4 hrs to fix

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

      render() {
        const { client, onPageChange } = this.props;
        const { view, email } = this.state;
    
        const signupLink = (
    Severity: Major
    Found in client/src/pages/login-page/index.js - About 4 hrs to fix

      Consider simplifying this complex logical expression.
      Open

      if (
        !SMTP_HOST || SMTP_HOST.trim().length === 0
        || !SMTP_USERNAME || SMTP_USERNAME.trim().length === 0
        || !SMTP_PASSWORD || SMTP_PASSWORD.trim().length === 0
        || !SMTP_PORT || SMTP_PORT.trim().length === 0
      Severity: Critical
      Found in server/src/startup/env-vars.js - About 1 hr to fix

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

          render() {
            const { btnLabel, disabled } = this.props;
            const { passcode, errors } = this.state;
        
            const passcodeErrors = ErrorHandling.getFieldErrors(errors, 'passcode');
        Severity: Minor
        Found in client/src/components/auth/passcode-form/index.js - About 1 hr to fix

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

            render() {
              const { btnLabel, disabled } = this.props;
              const { email, errors } = this.state;
          
              const emailErrors = ErrorHandling.getFieldErrors(errors, 'email');
          Severity: Minor
          Found in client/src/components/auth/email-form/index.js - About 1 hr to fix

            Function showNotification has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

            function showNotification (event) {
              if (!(self.Notification && self.Notification.permission === 'granted')) {
                return;
              }
            
            
            Severity: Minor
            Found in client/public/push-listener.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

            Consider simplifying this complex logical expression.
            Open

            if (
              !VAPID_SUBJECT || VAPID_SUBJECT.trim().length === 0
              || !VAPID_PUBLIC_KEY || VAPID_PUBLIC_KEY.trim().length === 0
              || !VAPID_PRIVATE_KEY || VAPID_PRIVATE_KEY.trim().length === 0
            ) {
            Severity: Major
            Found in server/src/startup/env-vars.js - About 40 mins to fix
              Severity
              Category
              Status
              Source
              Language