auth0-extensions/auth0-sso-dashboard-extension

View on GitHub

Showing 60 of 60 total issues

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

export function fetchApplicationsAll() {
  return (dispatch) => {
    dispatch({
      type: constants.FETCH_APPLICATIONS,
      payload: {
Severity: Major
Found in client/actions/application.js and 3 other locations - About 1 hr to fix
client/actions/application.js on lines 9..20
client/actions/application.js on lines 40..51
client/actions/application.js on lines 56..67

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

export function fetchClients() {
  return (dispatch) => {
    dispatch({
      type: constants.FETCH_CLIENTS,
      payload: {
Severity: Major
Found in client/actions/application.js and 3 other locations - About 1 hr to fix
client/actions/application.js on lines 9..20
client/actions/application.js on lines 24..35
client/actions/application.js on lines 56..67

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

export function fetchConnections() {
  return (dispatch) => {
    dispatch({
      type: constants.FETCH_CONNECTIONS,
      payload: {
Severity: Major
Found in client/actions/application.js and 3 other locations - About 1 hr to fix
client/actions/application.js on lines 9..20
client/actions/application.js on lines 24..35
client/actions/application.js on lines 40..51

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

export function fetchApplications() {
  return (dispatch) => {
    dispatch({
      type: constants.FETCH_APPLICATIONS,
      payload: {
Severity: Major
Found in client/actions/application.js and 3 other locations - About 1 hr to fix
client/actions/application.js on lines 24..35
client/actions/application.js on lines 40..51
client/actions/application.js on lines 56..67

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

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

                  { validationErrors && validationErrors[fieldName] && validationErrors[fieldName].length && <div className="help-block">{ validationErrors[fieldName][0] }</div> }
            Severity: Major
            Found in client/components/Dashboard/InputText.jsx and 2 other locations - About 55 mins to fix
            client/components/Dashboard/InputCheckBox.jsx on lines 15..15
            client/components/Dashboard/InputCombo.jsx on lines 20..20

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

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

                  { validationErrors && validationErrors[fieldName] && validationErrors[fieldName].length && <div className="help-block">{ validationErrors[fieldName][0] }</div> }
            Severity: Major
            Found in client/components/Dashboard/InputCombo.jsx and 2 other locations - About 55 mins to fix
            client/components/Dashboard/InputCheckBox.jsx on lines 15..15
            client/components/Dashboard/InputText.jsx on lines 15..15

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

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

                  { validationErrors && validationErrors[fieldName] && validationErrors[fieldName].length && <div className="help-block">{ validationErrors[fieldName][0] }</div> }
            Severity: Major
            Found in client/components/Dashboard/InputCheckBox.jsx and 2 other locations - About 55 mins to fix
            client/components/Dashboard/InputCombo.jsx on lines 20..20
            client/components/Dashboard/InputText.jsx on lines 15..15

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

            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

            export function fetchConnections() { // eslint-disable-line import/prefer-default-export
              return {
                type: constants.FETCH_CONNECTIONS,
                payload: {
                  promise: axios.get('/api/connections', {
            Severity: Minor
            Found in client/actions/connection.js and 1 other location - About 50 mins to fix
            client/actions/status.js on lines 5..14

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

            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

            export function fetchStatus() { // eslint-disable-line import/prefer-default-export
              return {
                type: constants.FETCH_STATUS,
                payload: {
                  promise: axios.get('/api/status', {
            Severity: Minor
            Found in client/actions/status.js and 1 other location - About 50 mins to fix
            client/actions/connection.js on lines 4..13

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

            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

                      <div className="row">
                        <div className="col-xs-12 wrapper">
                          <Error message={error} />
                        </div>
                      </div>
            Severity: Major
            Found in client/components/Applications/ApplicationOverview.jsx and 2 other locations - About 45 mins to fix
            client/components/Applications/UserApplicationOverview.jsx on lines 25..29
            client/containers/Authorization.jsx on lines 88..92

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

            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

                      <div className="row">
                        <div className="col-xs-12 wrapper">
                          <Error message={error} />
                        </div>
                      </div>
            Severity: Major
            Found in client/components/Applications/UserApplicationOverview.jsx and 2 other locations - About 45 mins to fix
            client/components/Applications/ApplicationOverview.jsx on lines 38..42
            client/containers/Authorization.jsx on lines 88..92

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

            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

            Severity
            Category
            Status
            Source
            Language