musashimm/cimd

View on GitHub

Showing 6 of 6 total issues

Method receive_data has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def receive_data(data)
    #puts "Received plain data: #{data}"
  
      case data
        when /CIMD2-A/
Severity: Minor
Found in lib/cimd_loop.rb - About 2 hrs 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 receive_data has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def receive_data(data)
    #puts "Received plain data: #{data}"
  
      case data
        when /CIMD2-A/
Severity: Minor
Found in lib/cimd_loop.rb - About 1 hr to fix

    Method post_init has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def post_init
          
          @timer = EM.add_periodic_timer(1) do
      
          if @@logout_request == true 
    Severity: Minor
    Found in lib/cimd_loop.rb - About 1 hr to fix

      Method opcode_description has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def self.opcode_description(op_code)
          descs = {
            OP_LOGIN => "OP_LOGIN",
            OP_LOGOUT => "OP_LOGOUT",
            OP_SUBMIT=> "OP_SUBMIT",
      Severity: Minor
      Found in lib/cimd_constants.rb - About 1 hr to fix

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

            def initialize(server,port,user_identity,password,alpha_orig_address,window_size,keep_alive)
        Severity: Major
        Found in lib/cimd_structures.rb - About 50 mins to fix

          Method post_init has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def post_init
                
                @timer = EM.add_periodic_timer(1) do
            
                if @@logout_request == true 
          Severity: Minor
          Found in lib/cimd_loop.rb - About 45 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