eagletmt/kaede

View on GitHub

Showing 5 of 17 total issues

Function main has 92 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func main() {
    app := cli.NewApp()

    app.Usage = "CLI for kaede"
    app.Commands = []cli.Command{
Severity: Major
Found in kaede-cli/main.go - About 2 hrs to fix

    Class Recorder has 24 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class Recorder
        def initialize(notifier)
          @notifier = notifier
        end
    
    
    Severity: Minor
    Found in lib/kaede/recorder.rb - About 2 hrs to fix

      Method prepare_tables has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def prepare_tables
            @db.create_table?(:channels) do
              primary_key :id
              String :name, size: 255, null: false, unique: true
              Integer :for_recorder, null: false, unique: true
      Severity: Minor
      Found in lib/kaede/database.rb - About 1 hr to fix

        Function main has 7 return statements (exceeds 4 allowed).
        Open

        func main() {
            app := cli.NewApp()
        
            app.Usage = "CLI for kaede"
            app.Commands = []cli.Command{
        Severity: Major
        Found in kaede-cli/main.go - About 45 mins to fix

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

              def redo_ts_process(program)
                unless system(Kaede.config.b25.to_s, '-v0', '-s1', '-m1', record_path(program).to_s, cache_path(program).to_s)
                  @notifier.notify_redo_error(program)
                  return false
                end
          Severity: Minor
          Found in lib/kaede/recorder.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