nesquena/gitdocs

View on GitHub

Showing 31 of 676 total issues

Avoid too many return statements within this function.
Open

      if (distance_in_minutes < 2880) { return '1 day ago'; }
Severity: Major
Found in lib/gitdocs/public/js/util.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          if (distance_in_minutes < 1051199) { return 'about 1 year ago'; }
    Severity: Major
    Found in lib/gitdocs/public/js/util.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            if (distance_in_minutes < 525960) { return Math.floor(distance_in_minutes / 43200) + ' months ago'; }
      Severity: Major
      Found in lib/gitdocs/public/js/util.js - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

              return :conflict if e.err[/\[rejected\]/]
        Severity: Major
        Found in lib/gitdocs/repository.rb - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                if (distance_in_minutes < 43200) { return Math.floor(distance_in_minutes / 1440) + ' days ago'; }
          Severity: Major
          Found in lib/gitdocs/public/js/util.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  if (distance_in_minutes < 1440) { return Math.floor(distance_in_minutes / 60) + ' hours ago'; }
            Severity: Major
            Found in lib/gitdocs/public/js/util.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return 'over ' + Math.floor(distance_in_minutes / 525960) + ' years ago';
              Severity: Major
              Found in lib/gitdocs/public/js/util.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      if (distance_in_minutes < 86400) { return '1 month ago'; }
                Severity: Major
                Found in lib/gitdocs/public/js/util.js - About 30 mins to fix

                  Method status has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def status
                        say "GitDoc v#{VERSION}"
                        say "Running: #{running?}"
                        say "File System Watch Method: #{Gitdocs::Manager.listen_method}"
                        say 'Watched repositories:'
                  Severity: Minor
                  Found in lib/gitdocs/cli.rb - 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

                  Method synchronize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def synchronize(type)
                        result = { merge: nil, push: nil }
                        return result unless valid?
                  
                        case type
                  Severity: Minor
                  Found in lib/gitdocs/repository.rb - 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

                  Method for_push has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def for_push(result)
                        return if result.nil?
                        return if result == :no_remote
                        return if result == :nothing
                  
                  
                  Severity: Minor
                  Found in lib/gitdocs/git_notifier.rb - 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