nadoka/nadoka

View on GitHub

Showing 69 of 69 total issues

Avoid too many return statements within this method.
Open

        return false
Severity: Major
Found in ndk/server.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return false
    Severity: Major
    Found in ndk/server.rb - About 30 mins to fix

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

          def server_setting
            if svrs = @config[:servers]
              svl = []
              svrs.each{|si|
                ports = si[:port] || 6667
      Severity: Minor
      Found in ndk/config.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 check_entries has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def check_entries
            et = @entry_time
            res = []
            CSV::Reader.parse(read_content){|row|
              last_detected = Time.at(row[2].data.to_i)
      Severity: Minor
      Found in lib/rss_check.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 send_from_client has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def send_from_client msg, from
            until @manager.connected
              # ignore
              return
            end
      Severity: Minor
      Found in ndk/client.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 make_default_logwriter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def make_default_logwriter
            if @config[:default_log].kind_of? Hash
              dl = @config[:default_log]
            else
              # defult_log must be Hash
      Severity: Minor
      Found in ndk/config.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 nadoka_client_command has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def nadoka_client_command cmd, args
            cmd ||= ''
            case cmd.upcase
            when 'QUIT'
              @manager.invoke_event :quit_program
      Severity: Minor
      Found in ndk/client.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 on_mode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

            def on_mode nick, args
              while mode = args.shift
                modes = mode.split(//)
                flag  = modes.shift
                modes.each{|m|
      Severity: Minor
      Found in ndk/server_state.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 read_content has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def read_content
            case @uri.scheme
            when 'http', 'https'
              open(@uri){|f|
                if f.content_encoding.any?{|e| /gzip/ =~ e}
      Severity: Minor
      Found in lib/rss_check.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