nazoking/openfire_admin

View on GitHub

Showing 6 of 8 total issues

Method request has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def request(req)
      Net::HTTP.start(@url.host, @url.port) do |http|
        http.use_ssl = true if @url.scheme == 'https'
        puts "#{req.method} #{req.path}" if @verbos
        req['Host'] = @url.host
Severity: Minor
Found in lib/openfire_admin/http_client.rb - 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 get_properties has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def get_properties
      ret = {}
      get("/server-properties.jsp") do |res|
        raise ResponceException.new("can't read",res) unless res.code== "200"
        doc = HtmlParser.new(res.body)
Severity: Minor
Found in lib/openfire_admin/property_map.rb - 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

Method compare has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def compare(me,othre)
      m = me.shift
      o = othre.shift
      if m.nil?
        return o.nil? ? 0 : -1
Severity: Minor
Found in lib/openfire_admin/version_string.rb - 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

Method database_standard has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def database_standard(driver,serverURL,username,password,
                               maxConnections=25,minConnections=5,
                               connectionTimeout=1.0)
Severity: Major
Found in lib/openfire_admin/setup_wizard.rb - About 50 mins to fix

    Method create has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def create(username,password,name,email,isadmin=false)
    Severity: Minor
    Found in lib/openfire_admin/user_admin.rb - About 35 mins to fix

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

          def []( name )
            v = @cache[name]
            if v.nil? and @cache.has_key?(name)
              if strong_hidden?
                :hide
      Severity: Minor
      Found in lib/openfire_admin/property_map.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