heroku/heroku-orgs

View on GitHub

Showing 10 of 28 total issues

Function run has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function * run (context, heroku) {
  let orgInfo = yield Utils.orgInfo(context, heroku)
  let groupName = context.org || context.team || context.flags.team
  let teamInviteFeatureEnabled = false
  let isInvitedUser = false
Severity: Minor
Found in commands/members/remove.js - About 1 hr to fix

    Function run has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function * run (context, heroku) {
      let orgInfo = yield Utils.orgInfo(context, heroku)
      let groupName = context.org || context.team || context.flags.team
      let teamInvites = []
    
    
    Severity: Minor
    Found in commands/members/index.js - About 1 hr to fix

      Function run has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      function * run (context, heroku) {
        let app = context.app
        let recipient = context.args.recipient
      
        // App transfers in bulk
      Severity: Minor
      Found in commands/apps/transfer.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 run has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function * run (context, heroku) {
        let app = context.app
        let recipient = context.args.recipient
      
        // App transfers in bulk
      Severity: Minor
      Found in commands/apps/transfer.js - About 1 hr to fix

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

        function * run (context, heroku) {
          let orgInfo = yield Utils.orgInfo(context, heroku)
          let groupName = context.org || context.team || context.flags.team
          let teamInvites = []
        
        
        Severity: Minor
        Found in commands/members/index.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 run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        async function run (context, heroku) {
          let appName = context.app
          let permissions = context.flags.permissions || context.flags.privileges || ''
          let appInfo = await heroku.get(`/apps/${appName}`)
          let output = `Adding ${cli.color.cyan(context.args.email)} access to the app ${cli.color.magenta(appName)}`
        Severity: Minor
        Found in commands/access/add.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

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

        let addMemberToOrg = function * (email, role, groupName, heroku, method = 'PUT') {
        Severity: Minor
        Found in lib/utils.js - About 35 mins to fix

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

          async function run (context, heroku) {
            let appName = context.app
          
            let app = await heroku.get(`/apps/${appName}`)
            let isOrgApp = Utils.isOrgApp(app.owner.email)
          Severity: Minor
          Found in commands/access/index.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 run has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function * run (context, heroku) {
            let orgInfo = yield Utils.orgInfo(context, heroku)
            let groupName = context.org || context.team || context.flags.team
            let teamInviteFeatureEnabled = false
            let isInvitedUser = false
          Severity: Minor
          Found in commands/members/remove.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 constructor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            constructor (opts) {
              this.opts = opts
              this.heroku = this.opts.heroku
              this.appName = this.opts.appName
              this.recipient = this.opts.recipient
          Severity: Minor
          Found in lib/app_transfer.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

          Severity
          Category
          Status
          Source
          Language