auth0-extensions/auth0-delegated-administration-extension

View on GitHub

Showing 66 of 178 total issues

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

  render() {
    const { error, loading, settings } = this.props;
    const languageDictionary = this.props.languageDictionary || {};
    const suppressRawData = settings && settings.suppressRawData === true;

Severity: Minor
Found in client/components/Logs/LogsTable.jsx - About 1 hr to fix

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

      render() {
        const { cancelPasswordChange, settings, connections } = this.props;
        const { connection, user, error, requesting, loading } = this.props.passwordChange.toJS();
    
        const userFields = settings.userFields || [];
    Severity: Minor
    Found in client/containers/Users/Dialogs/PasswordChangeDialog.jsx - About 1 hr to fix

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

        render() {
          const { cancelRemoveMultiFactor, settings } = this.props;
          const { user, error, requesting, loading } = this.props.mfa.toJS();
          const userFields = settings.userFields || [];
          const languageDictionary = this.props.languageDictionary.get('record').toJS();
      Severity: Minor
      Found in client/containers/Users/Dialogs/RemoveMultiFactorDialog.jsx - About 1 hr to fix

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

          render() {
            const { cancelPasswordReset, settings, connections } = this.props;
            const { connection, user, error, requesting, loading } = this.props.passwordReset.toJS();
        
            if (!requesting) {
        Severity: Minor
        Found in client/containers/Users/Dialogs/PasswordResetDialog.jsx - About 1 hr to fix

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

            render() {
              const { cancelUsernameChange, connections, settings } = this.props;
              const { user, connection, error, requesting, loading } = this.props.usernameChange.toJS();
          
              if (!requesting) {
          Severity: Minor
          Found in client/containers/Users/Dialogs/UsernameChangeDialog.jsx - About 1 hr to fix

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

              render() {
                if (this.props.loading || this.props.error) {
                  return <div></div>;
                }
            
            
            Severity: Minor
            Found in client/components/Users/UserHeader.jsx - About 1 hr to fix

              Function RequireAuthentication has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

              export default function RequireAuthentication(InnerComponent) {
                class RequireAuthenticationContainer extends React.Component {
                  static propTypes = {
                    push: PropTypes.func.isRequired,
                    auth: PropTypes.object.isRequired,
              Severity: Minor
              Found in client/containers/RequireAuthentication.jsx - 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 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render() {
                  const { error, loading, settings } = this.props;
              
                  if (!error && this.props.logs.size === 0) {
                    return <div>There are no logs available for this user.</div>;
              Severity: Minor
              Found in client/components/Users/UserLogs.jsx - About 1 hr to fix

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

                  render() {
                
                    const {
                      submitting,
                      customFields,
                Severity: Minor
                Found in client/components/Users/UserForm.jsx - About 1 hr to fix

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

                    render() {
                      const { nextPage, pages } = this.props;
                  
                      return (
                        <nav className="pull-right">
                  Severity: Minor
                  Found in client/components/Users/UserPaginator.jsx - About 1 hr to fix

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

                      render() {
                        const { settingsLoading } = this.props;
                        const languageDictionary = this.props.languageDictionary ? this.props.languageDictionary.toJS() : {};
                        const settings = this.props.settings.get('settings') && this.props.settings.get('settings').toJS();
                        const renderCssToggle = !!(settings && settings.css && settings.altcss);
                    Severity: Minor
                    Found in client/containers/App.jsx - About 1 hr to fix

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

                      export default function (cfg, storageProvider) {
                        config.setProvider(cfg);
                      
                        const storage = storageProvider
                          ? new tools.WebtaskStorageContext(storageProvider, { force: 1 })
                      Severity: Minor
                      Found in server/index.js - About 1 hr to fix

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

                        export const getValue = (user, field, languageDictionary = {}, additionalData = {}) => {
                          if (!user || user.size === 0) {
                            return null;
                          }
                        
                        
                        Severity: Minor
                        Found in client/utils/display.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 { cancelEmailChange, settings, connections } = this.props;
                            const { user, connection, error, requesting, loading } = this.props.emailChange.toJS();
                        
                            const userFields = settings.userFields || [];
                        Severity: Minor
                        Found in client/containers/Users/Dialogs/EmailChangeDialog.jsx - About 1 hr to fix

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

                            render() {
                              const { log, logs, accessLevel, languageDictionary, settings } = this.props;
                              const originalTitle = (settings.dict && settings.dict.title) || window.config.TITLE || 'User Management';
                              document.title = `${languageDictionary.userLogsTabTitle || 'Logs'} - ${originalTitle}`;
                          
                          
                          Severity: Minor
                          Found in client/containers/Logs.jsx - About 1 hr to fix

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

                              render() {
                                const { user, issuer, accessLevel } = this.props;
                                const languageDictionary = this.props.languageDictionary || {};
                                const isAdmin = accessLevel.role === 3;
                                return (
                            Severity: Minor
                            Found in client/components/Header.jsx - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                  if (action && action.type.endsWith('_REJECTED') && action.payload) {
                                    // Try to get the default error message from the response.
                                    let message = action.payload.statusText || action.payload.status || 'Unknown Server Error';
                              
                                    const status = (action.payload.response && action.payload.response.status) || 500;
                              Severity: Critical
                              Found in client/middlewares/normalizeErrorMiddleware.js - About 1 hr to fix

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

                                  getMenu(isAdmin, languageDictionary) {
                                    if (!isAdmin) {
                                      return (
                                        <ul role="menu" className="dropdown-menu">
                                          {this.renderCssSwitcher(languageDictionary)}
                                Severity: Minor
                                Found in client/components/Header.jsx - About 1 hr to fix

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

                                    render() {
                                      const { error, loading, settings } = this.props;
                                      if (loading) {
                                        return <div></div>;
                                      }
                                  Severity: Minor
                                  Found in client/components/Users/UserDevices.jsx - About 1 hr to fix

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

                                      render() {
                                        const { error, loading, record } = this.props.userCreate.toJS();
                                        const connections = this.props.connections.toJS();
                                        const accessLevel = this.props.accessLevel.get('record').toJS();
                                        const languageDictionary = this.props.languageDictionary.get('record').toJS();
                                    Severity: Minor
                                    Found in client/containers/Users/Dialogs/CreateDialog.jsx - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language