zephinzer/dev

View on GitHub

Showing 57 of 79 total issues

Function WatchNotifications has a Cognitive Complexity of 64 (exceeds 20 allowed). Consider refactoring.
Open

func WatchNotifications(
    accounts []AccountConfig,
    databaseConnection *sql.DB,
    updateInterval time.Duration,
    stop chan struct{},
Severity: Minor
Found in internal/gitlab/watchers.go - About 7 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 Untar has a Cognitive Complexity of 53 (exceeds 20 allowed). Consider refactoring.
Open

func Untar(options UntarOptions) []error {
    var err error
    status := UntarStatus{}

    if options.Events == nil {
Severity: Minor
Found in pkg/utils/untar.go - About 5 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 WatchNotifications has a Cognitive Complexity of 51 (exceeds 20 allowed). Consider refactoring.
Open

func WatchNotifications(
    accessToken string,
    fromProjects Projects,
    databaseConnection *sql.DB,
    updateInterval time.Duration,
Severity: Minor
Found in internal/pivotaltracker/watchers.go - About 5 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 GetCommand has a Cognitive Complexity of 47 (exceeds 20 allowed). Consider refactoring.
Open

func GetCommand() *cobra.Command {
    cmd := cobra.Command{
        Use:     constants.SoftwareCanonicalNoun,
        Aliases: constants.SoftwareAliases,
        Short:   "verifies that required software specified in the configuration is installed",
Severity: Minor
Found in cmd/dev/check/software/command.go - 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 Unzip has a Cognitive Complexity of 44 (exceeds 20 allowed). Consider refactoring.
Open

func Unzip(options UnzipOptions) []error {
    var err error
    status := UnzipStatus{}

    if options.Events == nil {
Severity: Minor
Found in pkg/utils/unzip.go - 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 Untar has 123 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func Untar(options UntarOptions) []error {
    var err error
    status := UntarStatus{}

    if options.Events == nil {
Severity: Major
Found in pkg/utils/untar.go - About 3 hrs to fix

    Function Unzip has 102 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func Unzip(options UnzipOptions) []error {
        var err error
        status := UnzipStatus{}
    
        if options.Events == nil {
    Severity: Major
    Found in pkg/utils/unzip.go - About 3 hrs to fix

      Function run has 86 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func run(command *cobra.Command, args []string) {
          if len(args) == 0 {
              command.Help()
              log.Errorf("no repository url(s) specified, see usage above for how to use this command")
              os.Exit(1)
      Severity: Major
      Found in cmd/dev/add/repository/command.go - About 2 hrs to fix

        Function getOAuthCallbackHandler has 78 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func getOAuthCallbackHandler(res http.ResponseWriter, req *http.Request) {
            requestID := uuid.New().String()
        
            params := mux.Vars(req)
        
        
        Severity: Major
        Found in cmd/dev/start/server/get_oauth_callback.go - About 2 hrs to fix

          Function Download has 69 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func Download(options DownloadOptions) error {
              downloadStatus := DownloadStatus{}
              tmpFilePath := options.FilePath + ".download_" + time.Now().Format("20060102150405")
              if options.Events == nil {
                  options.Events = make(chan DownloadEvent, 16)
          Severity: Minor
          Found in pkg/utils/network/download.go - About 1 hr to fix

            Function run has 67 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func run(command *cobra.Command, args []string) {
                if config.Global.Repositories == nil {
                    log.Error("no repositories have been defined")
                    os.Exit(1)
                    return
            Severity: Minor
            Found in cmd/dev/install/repository/command.go - About 1 hr to fix

              Function WatchNotifications has 67 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func WatchNotifications(
                  accounts []AccountConfig,
                  databaseConnection *sql.DB,
                  updateInterval time.Duration,
                  stop chan struct{},
              Severity: Minor
              Found in internal/gitlab/watchers.go - About 1 hr to fix

                Function run has 65 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func run(command *cobra.Command, args []string) {
                    if config.Global.Repositories == nil {
                        log.Error("no repositories have been defined")
                        os.Exit(1)
                        return
                Severity: Minor
                Found in cmd/dev/check/repositories/command.go - About 1 hr to fix

                  Function GetCommand has 65 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func GetCommand() *cobra.Command {
                      cmd := cobra.Command{
                          Use:     constants.ClientCanonicalNoun,
                          Aliases: constants.ClientAliases,
                          Short:   "starts the dev client as a background process to provide notifications",
                  Severity: Minor
                  Found in cmd/dev/start/client/command.go - About 1 hr to fix

                    Function GetCommand has 65 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func GetCommand() *cobra.Command {
                        cmd := cobra.Command{
                            Use:     constants.SoftwareCanonicalNoun,
                            Aliases: constants.SoftwareAliases,
                            Short:   "verifies that required software specified in the configuration is installed",
                    Severity: Minor
                    Found in cmd/dev/check/software/command.go - About 1 hr to fix

                      Function startFuzzySearchInterface has 63 lines of code (exceeds 50 allowed). Consider refactoring.
                      Open

                      func startFuzzySearchInterface() {
                          links := config.Global.Links
                          repositories := config.Global.Repositories
                          for _, link := range links {
                              searchTerms = append(searchTerms, fmt.Sprintf("%s [%s] @ %s", link.Label, strings.Join(link.Categories, ", "), link.URL))
                      Severity: Minor
                      Found in cmd/dev/go_to/gui.go - About 1 hr to fix

                        Function run has 57 lines of code (exceeds 50 allowed). Consider refactoring.
                        Open

                        func run(command *cobra.Command, args []string) {
                            targetWorkspaceName := strings.Join(args, ".")
                            if len(targetWorkspaceName) == 0 {
                                command.Help()
                                workspaces := c.Global.Repositories.GetWorkspaces()
                        Severity: Minor
                        Found in cmd/dev/get/workspace/command.go - About 1 hr to fix

                          Function GetCommand has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring.
                          Open

                          func GetCommand() *cobra.Command {
                              cmd := cobra.Command{
                                  Use:     constants.AccountCanonicalNoun,
                                  Aliases: constants.AccountAliases,
                                  Short:   "Retrieves account information from Trello",
                          Severity: Minor
                          Found in cmd/dev/get/trello/account/command.go - 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

                          Method TodoSerializer.GetMessage has 55 lines of code (exceeds 50 allowed). Consider refactoring.
                          Open

                          func (ts TodoSerializer) GetMessage() string {
                              targetType := ts.getTargetType()
                              createdAt := humanize.Time(ts.CreatedAt)
                              switch ts.ActionName {
                              case "assigned":
                          Severity: Minor
                          Found in internal/gitlab/todos.go - About 1 hr to fix

                            Function WatchNotifications has 55 lines of code (exceeds 50 allowed). Consider refactoring.
                            Open

                            func WatchNotifications(
                                accessToken string,
                                fromProjects Projects,
                                databaseConnection *sql.DB,
                                updateInterval time.Duration,
                            Severity: Minor
                            Found in internal/pivotaltracker/watchers.go - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language