hackedteam/rcs-db

View on GitHub
lib/rcs-worker/call_processor.rb

Summary

Maintainability
C
7 hrs
Test Coverage

File call_processor.rb has 326 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'ffi'
require 'mongoid'
require 'stringio'
require 'digest/md5'

Severity: Minor
Found in lib/rcs-worker/call_processor.rb - About 3 hrs to fix

    Method feed has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def feed(evidence)
        # keep track of how many chunks we have eaten before returning from processor#feed
        @raw_counter += 1
        
        # if evidence is empty or call is closed, refuse feeding
    Severity: Minor
    Found in lib/rcs-worker/call_processor.rb - About 1 hr to fix

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

        def initialize(peer, caller, program, incoming, start_time, agent, target)
      Severity: Major
      Found in lib/rcs-worker/call_processor.rb - About 50 mins to fix

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

          def store(peer, caller, program, incoming, start_time, agent, target)
        Severity: Major
        Found in lib/rcs-worker/call_processor.rb - About 50 mins to fix

          Method feed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            def feed(evidence)
              # keep track of how many chunks we have eaten before returning from processor#feed
              @raw_counter += 1
              
              # if evidence is empty or call is closed, refuse feeding
          Severity: Minor
          Found in lib/rcs-worker/call_processor.rb - About 35 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

          There are no issues that match your filters.

          Category
          Status