auth0-extensions/auth0-delegated-administration-extension

View on GitHub

Showing 178 of 178 total issues

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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  <img
                    role="presentation"
                    className="img-polaroid"
                    src={this.getPicture(user, userFields)}
                    alt={languageDictionary.userImageTitle || 'User Image'}
          Severity: Major
          Found in client/components/Users/UserHeader.jsx and 1 other location - About 1 hr to fix
          client/components/Users/UserHeader.jsx on lines 81..87

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 63.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                    <img
                      role="presentation"
                      className="user-bg"
                      src={this.getPicture(user, userFields)}
                      alt={languageDictionary.userImageTitle || 'User Image'}
          Severity: Major
          Found in client/components/Users/UserHeader.jsx and 1 other location - About 1 hr to fix
          client/components/Users/UserHeader.jsx on lines 73..79

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 63.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                  const customListFields = _(userFields)
                    .filter(field => _.isObject(field.search) || (_.isBoolean(field.search) && field.search === true))
                    .map((field) => {
                      if (_.isBoolean(field.search) && field.search === true) {
                        const defaultField = Object.assign({}, field, {
            Severity: Major
            Found in client/components/Users/UsersTable.jsx and 1 other location - About 1 hr to fix
            client/components/Users/UsersTable.jsx on lines 124..126

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 62.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    const customFieldProperties = _(userFields)
                      .filter(field => _.isObject(field.search) || (_.isBoolean(field.search) && field.search === true))
                      .map('property')
            Severity: Major
            Found in client/components/Users/UsersTable.jsx and 1 other location - About 1 hr to fix
            client/components/Users/UsersTable.jsx on lines 105..118

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 62.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      if (user.blocked) {
                        return (
                          <MenuItem disabled={loading || false} onClick={this.unblockUser}>
                            {this.state.languageDictionary.unblockUserMenuItemText || "Unblock User"}
                          </MenuItem>
                  Severity: Major
                  Found in client/components/Users/UserActions.jsx and 1 other location - About 1 hr to fix
                  client/components/Users/UserActions.jsx on lines 209..215

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 60.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      if (user.blocked_for && user.blocked_for.length) {
                        return (
                          <MenuItem disabled={loading || false} onClick={this.removeBlockedIPs}>
                            {this.state.languageDictionary.removeBlockedIPsMenuItemText || "Unblock for all IPs"}
                          </MenuItem>
                  Severity: Major
                  Found in client/components/Users/UserActions.jsx and 1 other location - About 1 hr to fix
                  client/components/Users/UserActions.jsx on lines 193..199

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 60.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                      if (constants.VALID_SCRIPTS.indexOf(req.params.name) < 0) {
                        return next(new ValidationError(`Invalid script name: ${req.params.name}`));
                      }
                  Severity: Major
                  Found in server/routes/scripts.js and 1 other location - About 1 hr to fix
                  server/routes/scripts.js on lines 19..21

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 59.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  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

                    Function RequireAuthentication has 30 lines of code (exceeds 25 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

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                          if (constants.VALID_SCRIPTS.indexOf(req.params.name) < 0) {
                            return next(new ValidationError(`Invalid script name: ${req.params.name}`));
                          }
                      Severity: Major
                      Found in server/routes/scripts.js and 1 other location - About 1 hr to fix
                      server/routes/scripts.js on lines 9..11

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 59.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

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

                        render() {
                          const { logId, error, loading, onClose, settings } = this.props;
                          if (logId === null) {
                            return <div></div>;
                          }
                      Severity: Minor
                      Found in client/components/Logs/LogDialog.jsx - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language