rdkr/gitsync

View on GitHub

Showing 4 of 15 total issues

Method UI.Run has 57 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (ui *UI) Run() {

    for {

        select {
Severity: Minor
Found in sync/ui.go - About 1 hr to fix

    Function GitSync has 10 return statements (exceeds 4 allowed).
    Open

    func GitSync(g Git) Status {
    
        p := g // todo rename this variable
    
        repo, err := p.PlainOpen()
    Severity: Major
    Found in sync/sync.go - About 1 hr to fix

      Method UI.Run has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring.
      Open

      func (ui *UI) Run() {
      
          for {
      
              select {
      Severity: Minor
      Found in sync/ui.go - 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 GetGithubItemsFromCfg has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring.
      Open

      func GetGithubItemsFromCfg(cfg Config) ([]Group, []Project, []string) {
      
          var groups []Group
          var projects []Project
          var locations []string
      Severity: Minor
      Found in concurrency/config.go - 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

      Severity
      Category
      Status
      Source
      Language