auth0-extensions/auth0-sso-dashboard-extension

View on GitHub

Showing 22 of 60 total issues

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

  render() {
    const { application, loading, error, clients, connections } = this.props;
    const applicationJSON = application.toJSON();
    const initialValues = {
      name: this.props.currentName || applicationJSON.name || applicationJSON.client,
Severity: Major
Found in client/containers/Applications/Application.jsx - About 3 hrs to fix

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

      render() {
        const { applications, appId } = this.props;
        const rowsTotal = Object.keys(applications).length;
        let rowIndex = 0;
        return (
    Severity: Major
    Found in client/components/Applications/ApplicationsTable.jsx - About 3 hrs to fix

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

        render() {
          if (this.props.loading) {
            return <div />;
          }
          const types = [
      Severity: Major
      Found in client/components/Applications/ApplicationForm.jsx - About 2 hrs to fix

        Function makeRequest has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        const makeRequest = (req, path, method, payload) =>
          new Promise((resolve, reject) => getToken(req).then((token) => {
            request(method, `https://${config('AUTH0_DOMAIN')}/api/v2/${path}`)
              .query(method === 'GET' ? payload : {})
              .send(method === 'GET' ? null : payload || {})
        Severity: Minor
        Found in server/lib/queries.js - 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 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render() {
            const { loading, error, clients, applications, showModalCreate, showModalDelete, appId, createError } = this.props;
            const apps = this.state.apps.length != 0 ? this.state.apps : applications;
        
            return (
        Severity: Major
        Found in client/containers/Applications/Applications.jsx - About 2 hrs to fix

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

            render() {
              const { user, issuer, onLogout, isAdmin } = this.props;
              const allowAuthz = window.config.ALLOW_AUTHZ;
              return (
                <header className="dashboard-header">
          Severity: Major
          Found in client/components/Header.jsx - About 2 hrs to fix

            Function loadCredentials has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function loadCredentials() {
              return (dispatch) => {
                const credentials = loadForAdmin() || loadForUser();
            
                if (credentials) {
            Severity: Minor
            Found in client/actions/auth.js - About 2 hrs to fix

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

                render() {
                  const { loading, clients, connections, error, showModal } = this.props;
              
                  if (loading || error) {
                    return <div />;
              Severity: Minor
              Found in client/components/Applications/CreateApplicationDialog.jsx - About 1 hr to fix

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

                export default function (client, entity, opts = {}, perPage = 100, concurrency = 5) {
                  if (client === null || client === undefined) {
                    throw new ArgumentError('Must provide a auth0 client object.');
                  }
                
                
                Severity: Minor
                Found in server/lib/multipartRequest.js - About 1 hr to fix

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

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

                    Function getGroupsForUser has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export const getGroupsForUser = (userId) =>
                      new Promise((resolve, reject) =>
                        getAuthorizationTokenCached()
                          .then((token) => {
                            if (!token) {
                    Severity: Minor
                    Found in server/lib/queries.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 default has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export default function (client, entity, opts = {}, perPage = 100, concurrency = 5) {
                      if (client === null || client === undefined) {
                        throw new ArgumentError('Must provide a auth0 client object.');
                      }
                    
                    
                    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 saveApplication has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const saveApplication = (id, body, storage) => new Promise((resolve, reject) => {
                      const data = {
                        name: body.name,
                        client: body.client,
                        enabled: body.enabled,
                    Severity: Minor
                    Found in server/lib/applications.js - About 1 hr to fix

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

                        render() {
                          const { applications } = this.props;
                          return (
                            <div>
                              {Object.keys(applications).map((key) => {
                      Severity: Minor
                      Found in client/components/Applications/ApplicationsList.jsx - About 1 hr to fix

                        Function constructor has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          constructor(props) {
                            super(props);
                        
                            this.state = {
                              show: false
                        Severity: Minor
                        Found in client/components/Dashboard/LoadingPanel.jsx - About 1 hr to fix

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

                          export default function RequireAuthentication(InnerComponent) {
                            class RequireAuthenticationContainer extends React.Component {
                              componentWillMount() {
                                this.requireAuthentication();
                              }
                          Severity: Minor
                          Found in client/containers/RequireAuthentication.jsx - About 55 mins 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 config has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          const config = (key) => {
                            if (settings && settings[key]) {
                              return boolify(settings[key]);
                            }
                          
                          
                          Severity: Minor
                          Found in server/lib/config.js - About 55 mins 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 getGroups has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export const getGroups = () =>
                            new Promise((resolve, reject) =>
                              getAuthorizationTokenCached()
                                .then((token) => {
                                  if (!token) {
                          Severity: Minor
                          Found in server/lib/queries.js - About 45 mins 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 (action && action.type.endsWith('_REJECTED') && action.payload) {
                                let error = 'Unknown Server Error';
                                if (action.payload.code === 'ECONNABORTED') {
                                  error = 'The connectioned timed out.';
                                } else if (action.payload.data && action.payload.data.error) {
                          Severity: Major
                          Found in client/middlewares/normalizeErrorMiddleware.js - About 40 mins to fix

                            Function default has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            export default function (client, entity, opts = {}, perPage = 100, concurrency = 5) {
                            Severity: Minor
                            Found in server/lib/multipartRequest.js - About 35 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language