auth0-extensions/auth0-source-control-extension-tools

View on GitHub

Showing 36 of 99 total issues

Function calcDeployedVersionChanges has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  async calcDeployedVersionChanges(actionId, actionAsset, existingVersion) {
    const create = [];

    if (actionAsset.deployed) {
      const versionToCreate = {
Severity: Minor
Found in src/auth0/handlers/actions.js - About 35 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 getType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  async getType() {
    // in case client version does not support branding
    if (!this.client.branding || typeof this.client.branding.getSettings !== 'function') {
      return {};
    }
Severity: Minor
Found in src/auth0/handlers/branding.js - About 35 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 calcChanges has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  async calcChanges(actionsAssets, existing) {
    // Calculate the changes required between two sets of assets.
    const update = [];
    let del = [ ...existing ];
    const create = [];
Severity: Minor
Found in src/auth0/handlers/actions.js - About 35 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 getType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  async getType() {
    // in case client version does not support branding
    if (!this.client.prompts || typeof this.client.prompts.getSettings !== 'function') {
      return {};
    }
Severity: Minor
Found in src/auth0/handlers/prompts.js - About 35 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 getType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  async getType() {
    if (this.existing) {
      return this.existing;
    }

Severity: Minor
Found in src/auth0/handlers/actions.js - About 35 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

Avoid too many return statements within this function.
Open

        return [];
Severity: Major
Found in src/auth0/handlers/actions.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return [];
    Severity: Major
    Found in src/auth0/handlers/triggers.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return [];
      Severity: Major
      Found in src/auth0/handlers/actions.js - About 30 mins to fix

        Function getType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          async getType() {
            if (this.existing) {
              return this.existing;
            }
        
        
        Severity: Minor
        Found in src/auth0/handlers/organizations.js - About 25 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 getType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          async getType() {
            // in case client version does not support the operation
            if (!this.client.guardian || typeof this.client.guardian.getPhoneFactorSelectedProvider !== 'function') {
              return {};
            }
        Severity: Minor
        Found in src/auth0/handlers/guardianPhoneFactorSelectedProvider.js - About 25 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 updatePages has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          async updatePages(pages) {
            const toUpdate = pages.filter((p) => supportedPages.includes(p.name));
            const update = toUpdate.reduce((accum, page) => {
              if (supportedPages.includes(page.name)) {
                const pageName = pageNameMap[page.name];
        Severity: Minor
        Found in src/auth0/handlers/pages.js - About 25 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 calcChanges has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          async calcChanges(assets, includeExcluded = false) {
            let { rules } = assets;
        
            const excludedRules = (assets.exclude && assets.exclude.rules) || [];
        
        
        Severity: Minor
        Found in src/auth0/handlers/rules.js - About 25 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 actionChanges has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          async actionChanges(action, found) {
            const actionChanges = {};
        
            // if action is deployed, should compare against curren_version - calcDeployedVersionChanges method
            if (!action.deployed) {
        Severity: Minor
        Found in src/auth0/handlers/actions.js - About 25 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 getType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          async getType() {
            // in case client version does not support the operation
            if (!this.client.guardian || typeof this.client.guardian.getPhoneFactorMessageTypes !== 'function') {
              return {};
            }
        Severity: Minor
        Found in src/auth0/handlers/guardianPhoneFactorMessageTypes.js - About 25 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 getType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          async getType() {
            if (this.existing) {
              return this.existing;
            }
        
        
        Severity: Minor
        Found in src/auth0/handlers/roles.js - About 25 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 processChanges has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          async processChanges(assets) {
            const { clients } = assets;
        
            // Do nothing if not set
            if (!clients) return;
        Severity: Minor
        Found in src/auth0/handlers/clients.js - About 25 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

        Severity
        Category
        Status
        Source
        Language