heroku/heroku-apps

View on GitHub

Showing 45 of 106 total issues

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

function * run (context, heroku) {
  const statusHelper = require('../../status_helper')
  const time = require('../../time')
  const {truncate} = require('lodash')

Severity: Minor
Found in src/commands/releases/index.js - About 1 day 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 43 (exceeds 5 allowed). Consider refactoring.
Open

function * run (context, heroku) {
  const filesize = require('filesize')
  const util = require('util')
  const {countBy, snakeCase} = require('lodash')

Severity: Minor
Found in src/commands/apps/info.js - About 6 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 run has 125 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function * run (context, heroku) {
  const statusHelper = require('../../status_helper')
  const time = require('../../time')
  const {truncate} = require('lodash')

Severity: Major
Found in src/commands/releases/index.js - About 5 hrs to fix

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

    function * run (context, heroku) {
      const {sortBy, partition} = require('lodash')
    
      let team = context.org || context.team || context.flags.team
      let org = (!context.flags.personal && team) ? team : null
    Severity: Minor
    Found in src/commands/apps/index.js - About 4 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 run has 99 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function * run (context, heroku) {
      const filesize = require('filesize')
      const util = require('util')
      const {countBy, snakeCase} = require('lodash')
    
    
    Severity: Major
    Found in src/commands/apps/info.js - About 3 hrs to fix

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

      async function run (context, heroku) {
        const inquirer = require('inquirer')
        function confirmPrompt (message) {
          if (process.stdin.isTTY) {
            return inquirer.prompt([{
      Severity: Minor
      Found in src/commands/keys/add.js - About 3 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 run has 77 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function * run (context, heroku) {
        const {sortBy, partition} = require('lodash')
      
        let team = context.org || context.team || context.flags.team
        let org = (!context.flags.personal && team) ? team : null
      Severity: Major
      Found in src/commands/apps/index.js - About 3 hrs to fix

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

        function * run (context, heroku) {
          let app = context.app && !context.flags.all ? yield heroku.get(`/apps/${context.app}`) : null
          let notifications = yield heroku.request({host: 'telex.heroku.com', path: '/user/notifications'})
          if (app) notifications = notifications.filter((n) => n.target.id === app.id)
          if (!context.flags.read) {
        Severity: Minor
        Found in src/commands/notifications/index.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 run has 65 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        async function run (context, heroku) {
          const inquirer = require('inquirer')
          function confirmPrompt (message) {
            if (process.stdin.isTTY) {
              return inquirer.prompt([{
        Severity: Major
        Found in src/commands/keys/add.js - About 2 hrs to fix

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

          function * run (context, heroku) {
            const {sum, fromPairs} = require('lodash')
          
            const hours = parseInt(context.flags.hours) || 24
            const NOW = new Date().toISOString()
          Severity: Major
          Found in src/commands/apps/errors.js - About 2 hrs to fix

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

            function * run (context, heroku) {
              const img = require('term-img')
              const path = require('path')
            
              // if not testing and not logged in
            Severity: Major
            Found in src/commands/dashboard.js - About 2 hrs to fix

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

              function * run (context, heroku) {
                let app = context.app
              
                let parse = co.wrap(function * (args) {
                  if (args.length === 0) return []
              Severity: Major
              Found in src/commands/ps/type.js - About 2 hrs to fix

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

                function * run (context, heroku) {
                  const {app, flags, args} = context
                  const types = args
                  const {json, extended} = flags
                  const suffix = extended ? '?extended=true' : ''
                Severity: Minor
                Found in src/commands/ps/index.js - About 1 hr to fix

                  Function exports has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function (context) {
                    let sshGitUrl = (app) => `git@${context.gitHost}:${app}.git`
                    let gitUrl = (app) => `https://${context.httpGitHost}/${app}.git`
                  
                    function git (args) {
                  Severity: Minor
                  Found in src/git.js - About 1 hr to fix

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

                    function printDynos (dynos) {
                      let dynosByCommand = reduce(dynos, function (dynosByCommand, dyno) {
                        let since = time.ago(new Date(dyno.updated_at))
                        let size = dyno.size || '1X'
                    
                    
                    Severity: Minor
                    Found in src/commands/ps/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 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function * run (context, heroku) {
                      if (context.args.length === 0) {
                        cli.exit(1, 'Usage: heroku config:set KEY1=VALUE1 [KEY2=VALUE2 ...]\nMust specify KEY and VALUE to set.')
                      }
                    
                    
                    Severity: Minor
                    Found in src/commands/config/set.js - About 1 hr to fix

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

                      function * run (context, heroku) {
                        let app = context.app
                      
                        function parse (args) {
                          return compact(args.map((arg) => {
                      Severity: Minor
                      Found in src/commands/ps/scale.js - About 1 hr to fix

                        Function optimizeWidth has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          let optimizeWidth = function (releases, columns, optimizeKey) {
                            for (let col of columns) {
                              col.optimizationWidth = 0
                            }
                        
                        
                        Severity: Minor
                        Found in src/commands/releases/index.js - About 1 hr to fix

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

                          function * run (context, heroku) {
                            const {app, flags, args} = context
                            const types = args
                            const {json, extended} = flags
                            const suffix = extended ? '?extended=true' : ''
                          Severity: Minor
                          Found in src/commands/ps/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 printAccountQuota has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function * printAccountQuota (context, heroku, app, account) {
                            if (app.process_tier !== 'free') {
                              return
                            }
                          
                          
                          Severity: Minor
                          Found in src/commands/ps/index.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language