auth0-extensions/auth0-delegated-administration-extension

View on GitHub

Showing 66 of 178 total issues

File logTypes.js has 659 lines of code (exceeds 250 allowed). Consider refactoring.
Open

export default {
  s: {
    event: 'Success Login',
    icon: {
      name: '312',
Severity: Major
Found in client/utils/logTypes.js - About 1 day to fix

    File users.js has 464 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import _ from 'lodash';
    import auth0 from 'auth0';
    import request from 'request';
    import Promise from 'bluebird';
    import { Router } from 'express';
    Severity: Minor
    Found in server/routes/users.js - About 7 hrs to fix

      File user.js has 450 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import axios from 'axios';
      import { push } from 'react-router-redux';
      
      import * as constants from '../constants';
      import { fetchUserLogs } from './userLog';
      Severity: Minor
      Found in client/actions/user.js - About 6 hrs to fix

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

          render() {
            const code = this.state.code;
            const scripts = this.props.scripts.toJS();
            const { languageDictionary, settings } = this.props;
            const originalTitle = (settings.dict && settings.dict.title) || window.config.TITLE || 'User Management';
        Severity: Major
        Found in client/containers/Configuration/Configuration.jsx - About 4 hrs to fix

          Function getListFields has 104 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            getListFields(props) {
              const { userFields } = props;
              const defaultListFields = [
                {
                  listOrder: 0,
          Severity: Major
          Found in client/components/Users/UsersTable.jsx - About 4 hrs to fix

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

              render() {
                const { user, databaseConnections, log, logs, devices, settings, languageDictionary } = this.props;
                const userFields = (settings && settings.userFields) || [];
                const allowedUserFields = userFields.filter(field => field.property !== 'picture' && field.property !== 'client');
                const suppressRawData = settings && settings.suppressRawData === true;
            Severity: Major
            Found in client/containers/Users/User.jsx - About 3 hrs to fix

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

                render() {
                  const { user, error, loading, memberships, settings } = this.props;
                  const languageDictionary = this.props.languageDictionary || {};
                  const labels = languageDictionary.labels || {};
              
              
              Severity: Major
              Found in client/components/Users/UserInfo.jsx - About 3 hrs to fix

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

                  render() {
                    const { users, loading, sortProperty, sortOrder } = this.props;
                
                    const languageDictionary = this.props.languageDictionary || {};
                    const labels = languageDictionary.labels || {};
                Severity: Major
                Found in client/components/Users/UsersTable.jsx - About 2 hrs to fix

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

                    render() {
                      const {
                        loading,
                        error,
                        users,
                  Severity: Major
                  Found in client/containers/Users/Users.jsx - About 2 hrs to fix

                    UserActions has 25 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    export default class UserActions extends Component {
                      static propTypes = {
                        blockUser: PropTypes.func.isRequired,
                        changeEmail: PropTypes.func.isRequired,
                        changePassword: PropTypes.func.isRequired,
                    Severity: Minor
                    Found in client/components/Users/UserActions.jsx - About 2 hrs to fix

                      Function getListFields has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                      Open

                        getListFields(props) {
                          const { userFields } = props;
                          const defaultListFields = [
                            {
                              listOrder: 0,
                      Severity: Minor
                      Found in client/components/Users/UsersTable.jsx - About 2 hrs 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 18 (exceeds 5 allowed). Consider refactoring.
                      Open

                        render() {
                          const code = this.state.code;
                          const scripts = this.props.scripts.toJS();
                          const { languageDictionary, settings } = this.props;
                          const originalTitle = (settings.dict && settings.dict.title) || window.config.TITLE || 'User Management';
                      Severity: Minor
                      Found in client/containers/Configuration/Configuration.jsx - About 2 hrs 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 57 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        render() {
                          const { loading, sortProperty, sortOrder, error, settings } = this.props;
                          const languageDictionary = this.props.languageDictionary || {};
                          const labels = languageDictionary.labels || {};
                          const searchOptions = this.searchOptions.map((option) => {
                      Severity: Major
                      Found in client/components/Users/UserOverview.jsx - About 2 hrs to fix

                        Function processTokens has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const processTokens = (dispatch, apiToken, returnTo) => {
                          return new Promise((resolve, reject) => {
                            // check token expiration date
                            const decodedToken = jwtDecode(apiToken);
                            if (isTokenExpired(decodedToken)) {
                        Severity: Major
                        Found in client/actions/auth.js - About 2 hrs to fix

                          File UserActions.jsx has 259 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import React, { Component } from 'react';
                          import PropTypes from 'prop-types';
                          import { MenuItem, DropdownButton } from 'react-bootstrap';
                          import _ from 'lodash';
                          import { removeBlockedIPs } from "../../reducers/removeBlockedIPs";
                          Severity: Minor
                          Found in client/components/Users/UserActions.jsx - About 2 hrs to fix

                            Function getFieldByComponentName has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                            Open

                              getFieldByComponentName(field, componentName) {
                                const validate = (field.required || field.validationFunction) ? [] : undefined;
                                if (field.required) validate.push(requiredValidationFunction(this.props.languageDictionary || {}));
                                if (field.validationFunction) {
                                  validate.push((value, values, context) => field.validationFunction(value, values, context, this.props.languageDictionary || {}));
                            Severity: Minor
                            Found in client/components/Users/UserFormField.jsx - About 2 hrs 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 checkCustomFieldValidation has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const checkCustomFieldValidation = (req, context, isEditRequest, onlyTheseFields) => {
                              /* Exit early if no custom fields */
                              if (!context.userFields) return context.payload;
                            
                              const requiredErrorText = (req.query && req.query.requiredErrorText) || 'required';
                            Severity: Minor
                            Found in server/routes/users.js - About 1 hr to fix

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

                              export default function(client, entity, opts = {}, fetchOptions = {} ) {
                                const perPage = fetchOptions.perPage || 50;
                                const concurrency = fetchOptions.concurrency || 5;
                                const limit = fetchOptions.limit || null;
                              
                              
                              Severity: Minor
                              Found in server/lib/multipartRequest.js - About 1 hr to fix

                                Function default has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export default function(client, entity, opts = {}, fetchOptions = {} ) {
                                  const perPage = fetchOptions.perPage || 50;
                                  const concurrency = fetchOptions.concurrency || 5;
                                  const limit = fetchOptions.limit || null;
                                
                                
                                Severity: Minor
                                Found in server/lib/multipartRequest.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 getFieldByComponentName has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  getFieldByComponentName(field, componentName) {
                                    const validate = (field.required || field.validationFunction) ? [] : undefined;
                                    if (field.required) validate.push(requiredValidationFunction(this.props.languageDictionary || {}));
                                    if (field.validationFunction) {
                                      validate.push((value, values, context) => field.validationFunction(value, values, context, this.props.languageDictionary || {}));
                                Severity: Minor
                                Found in client/components/Users/UserFormField.jsx - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language