auth0-extensions/auth0-delegated-administration-extension

View on GitHub

Showing 178 of 178 total issues

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

        <li role="presentation">
          <Link to="/configuration" onFocus={this.showOnFocus} onBlur={this.hideOnBlur}>
            {languageDictionary.configurationMenuItemText || 'Configuration'}
          </Link>
        </li>
Severity: Major
Found in client/components/Header.jsx and 1 other location - About 1 hr to fix
client/components/Header.jsx on lines 90..94

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 69.

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

        <li role="presentation">
          <Link to="/users" onFocus={this.showOnFocus} onBlur={this.hideOnBlur}>
            {languageDictionary.usersAndLogsMenuItemText || 'Users & Logs'}
          </Link>
        </li>
Severity: Major
Found in client/components/Header.jsx and 1 other location - About 1 hr to fix
client/components/Header.jsx on lines 95..99

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 69.

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

      <Tab eventKey={4} title={languageDictionary.userProfileTabTitle || 'Profile'}>
        <UserProfile loading={user.get('loading')} user={user.get('record')} error={user.get('error')} languageDictionary={languageDictionary} settings={settings} />
      </Tab>
Severity: Major
Found in client/containers/Users/User.jsx and 1 other location - About 1 hr to fix
client/containers/Users/User.jsx on lines 102..104

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 69.

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 (field && (
      (_.isObject(field[type]) && field[type].disabled !== true) || _.isBoolean(field[type])
    )) field[type] = defaults[type];
Severity: Major
Found in client/utils/useDefaultFields.js and 1 other location - About 1 hr to fix
client/utils/useDefaultFields.js on lines 207..209

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 69.

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

          <div className="col-xs-12">
            <UserHeader loading={user.get('loading')} user={user.get('record')} error={user.get('error')} userFields={allowedUserFields} languageDictionary={languageDictionary} />
          </div>
Severity: Major
Found in client/containers/Users/User.jsx and 1 other location - About 1 hr to fix
client/containers/Users/User.jsx on lines 57..59

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 69.

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 (field && (
      (_.isObject(field[type]) && field[type].disabled !== true) || _.isBoolean(field[type])
    )) field[type] = defaults[type];
Severity: Major
Found in client/utils/useDefaultFields.js and 1 other location - About 1 hr to fix
client/utils/useDefaultFields.js on lines 126..128

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 69.

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 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

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

        shouldComponentUpdate(nextProps) {
          return nextProps.devices !== this.props.devices || nextProps.user !== this.props.user || nextProps.loading !== this.props.loading;
        }
      Severity: Major
      Found in client/components/Users/UserDevices.jsx and 2 other locations - About 1 hr to fix
      client/components/Users/UserProfile.jsx on lines 14..16
      client/containers/Users/Dialogs/FieldsChangeDialog.jsx on lines 34..38

      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 68.

      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 3 locations. Consider refactoring.
      Open

        shouldComponentUpdate(nextProps) {
          return nextProps.error !== this.props.error || nextProps.user !== this.props.user || nextProps.loading !== this.props.loading;
        }
      Severity: Major
      Found in client/components/Users/UserProfile.jsx and 2 other locations - About 1 hr to fix
      client/components/Users/UserDevices.jsx on lines 27..29
      client/containers/Users/Dialogs/FieldsChangeDialog.jsx on lines 34..38

      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 68.

      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 3 locations. Consider refactoring.
      Open

        shouldComponentUpdate(nextProps) {
          return nextProps.fieldsChange !== this.props.fieldsChange ||
            nextProps.userFields !== this.props.userFields ||
            nextProps.languageDictionary !== this.props.languageDictionary;
        }
      Severity: Major
      Found in client/containers/Users/Dialogs/FieldsChangeDialog.jsx and 2 other locations - About 1 hr to fix
      client/components/Users/UserDevices.jsx on lines 27..29
      client/components/Users/UserProfile.jsx on lines 14..16

      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 68.

      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 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

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

          static propTypes = {
            cancelPasswordReset: PropTypes.func.isRequired,
            resetPassword: PropTypes.func.isRequired,
            connections: PropTypes.object.isRequired,
            passwordReset: PropTypes.object.isRequired,
        Severity: Major
        Found in client/containers/Users/Dialogs/PasswordResetDialog.jsx and 2 other locations - About 1 hr to fix
        client/containers/Configuration/Configuration.jsx on lines 23..29
        client/containers/Users/Dialogs/BlockDialog.jsx on lines 22..28

        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 67.

        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 3 locations. Consider refactoring.
        Open

          static propTypes = {
            cancelBlockUser: PropTypes.func.isRequired,
            blockUser: PropTypes.func.isRequired,
            block: PropTypes.object.isRequired,
            settings: PropTypes.object.isRequired,
        Severity: Major
        Found in client/containers/Users/Dialogs/BlockDialog.jsx and 2 other locations - About 1 hr to fix
        client/containers/Configuration/Configuration.jsx on lines 23..29
        client/containers/Users/Dialogs/PasswordResetDialog.jsx on lines 35..41

        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 67.

        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 3 locations. Consider refactoring.
        Open

          static propTypes = {
            scripts: PropTypes.object.isRequired,
            settings: PropTypes.object.isRequired,
            fetchScript: PropTypes.func.isRequired,
            updateScript: PropTypes.func.isRequired,
        Severity: Major
        Found in client/containers/Configuration/Configuration.jsx and 2 other locations - About 1 hr to fix
        client/containers/Users/Dialogs/BlockDialog.jsx on lines 22..28
        client/containers/Users/Dialogs/PasswordResetDialog.jsx on lines 35..41

        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 67.

        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 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
                Severity
                Category
                Status
                Source
                Language