lunardial/fluent-plugin-parser_cef

View on GitHub

Showing 5 of 5 total issues

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

      def parse(text)
        if text.nil? || text.empty?
          yield nil, nil
          return
        end
Severity: Minor
Found in lib/fluent/plugin/parser_cef.rb - About 1 hr to fix

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

          def create_valid_format_regexp()
            case @log_format
            when "syslog"
              syslog_header = /
                  (?<syslog_timestamp>#{@syslog_timestamp_format})\s
    Severity: Minor
    Found in lib/fluent/plugin/parser_cef.rb - About 1 hr to fix

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

            def parse_cef_extension_with_strict_mode(text)
              record = {}
              begin
                last_valid_key_name = nil
                text.scan(@key_value_format_regexp) do |key, value|
      Severity: Minor
      Found in lib/fluent/plugin/parser_cef.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

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

            def parse(text)
              if text.nil? || text.empty?
                yield nil, nil
                return
              end
      Severity: Minor
      Found in lib/fluent/plugin/parser_cef.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

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

            def configure(conf)
              super
              @key_value_format_regexp = /([^\s=]+)=(.*?)(?:(?=[^\s=]+=)|\z)/
              @valid_format_regexp = create_valid_format_regexp
              @utc_offset = get_utc_offset(@log_utc_offset)
      Severity: Minor
      Found in lib/fluent/plugin/parser_cef.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