fluent/fluentd

View on GitHub

Showing 577 of 664 total issues

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

          def initialize(sock, socket_option_setter, close_callback, log, under_plugin_development, connect_callback)
Severity: Minor
Found in lib/fluent/plugin_helper/server.rb - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                      raise Fluent::ConfigError, "missing array index in '[]'. Invalid syntax: #{param}" if index_value == ']'
    Severity: Major
    Found in lib/fluent/plugin_helper/record_accessor.rb - About 45 mins to fix

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

            def error_sample
              pos = @ss.pos
      
              lines = @ss.string.lines.to_a
              lines.each_with_index { |line, ln|
      Severity: Minor
      Found in lib/fluent/config/basic_parser.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 scan_embedded_code has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

            def scan_embedded_code
              src = '"#{'+@ss.rest+"\n=begin\n=end\n}"
      
              seek = -1
              while (seek = src.index('}', seek + 1))
      Severity: Minor
      Found in lib/fluent/config/literal_parser.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 dump_value has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

            def dump_value(k, v, nindent)
              return "#{nindent}#{k} xxxxxx\n" if secret_param?(k)
              return "#{nindent}#{k} #{v}\n" unless @v1_config
      
              # for v1 config
      Severity: Minor
      Found in lib/fluent/config/element.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 write_step_by_step has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

            def write_step_by_step(metadata, data, format, splits_count, &block)
      Severity: Minor
      Found in lib/fluent/plugin/buffer.rb - About 35 mins to fix

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

              def build_request(method, id, scope = nil, params = nil, options = nil)
        Severity: Minor
        Found in lib/fluent/counter/client.rb - About 35 mins to fix

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

                def placeholder_validators(name, str, time_key = (@chunk_key_time && @buffer_config.timekey), tag_key = @chunk_key_tag, chunk_keys = @chunk_keys)
          Severity: Minor
          Found in lib/fluent/plugin/output.rb - About 35 mins to fix

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

                  def initialize(file, file_mutex, seek, pos, inode)
            Severity: Minor
            Found in lib/fluent/plugin/in_tail/position_file.rb - About 35 mins to fix

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

                    def socket_create(proto, host, port, **kwargs, &block)
              Severity: Minor
              Found in lib/fluent/plugin_helper/socket.rb - About 35 mins to fix

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

                      def initialize(name, arg, attrs, elements, unused = nil)
                Severity: Minor
                Found in lib/fluent/config/element.rb - About 35 mins to fix

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

                      def call
                        if Fluent.windows?
                          if /^[0-9]+$/.match?(@pid_or_svcname)
                            # Use as PID
                            return call_windows_event(@command, "fluentd_#{@pid_or_svcname}")
                  Severity: Minor
                  Found in lib/fluent/command/ctl.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 invoke has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def invoke(sock, ri, data)
                          @log.trace __callee__
                  
                          case ri.state
                          when :helo
                  Severity: Minor
                  Found in lib/fluent/plugin/out_forward/handshake_protocol.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 on_notify has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                          def on_notify(stat)
                            if stat.nil?
                              inode = nil
                              fsize = 0
                            else
                  Severity: Minor
                  Found in lib/fluent/plugin/in_tail.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 make_request_cached has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def make_request_cached(uri, req)
                        id = self.connection_cache_id_for_thread
                        if id.nil?
                          @connection_cache_id_mutex.synchronize {
                            id = @connection_cache_next_id
                  Severity: Minor
                  Found in lib/fluent/plugin/out_http.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 drop_capabilities has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def drop_capabilities(opts, target_file)
                        if drop_caps = opts[:drop_capabilities]
                          @capng.clear(:caps)
                          @capng.caps_file(target_file)
                          capabilities = drop_caps.split(/\s*,\s*/)
                  Severity: Minor
                  Found in lib/fluent/command/cap_ctl.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 start has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                          def start
                            @thread = ::Thread.new {
                              until @flag.wait_for_set(0.5)
                                now = Time.now
                                @mutex.synchronize {
                  Severity: Minor
                  Found in lib/fluent/plugin/parser.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 copy_license has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def copy_license
                      # in gem_name directory
                      return unless license_name
                      puts "License: #{license_name}"
                      license_class = self.class.lookup_license(license_name)
                  Severity: Minor
                  Found in lib/fluent/command/plugin_generator.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 select_healthy_node has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def select_healthy_node
                          error = nil
                  
                          # Don't care about the change of @weight_array's size while looping since
                          # it's only used for determining the number of loops and it is not so important.
                  Severity: Minor
                  Found in lib/fluent/plugin/out_forward/load_balancer.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 build_option has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def build_option(req)
                          qs = Hash.new { |_, _| [] }
                          # parse ?=query string
                          if req.query_string
                            qs.merge!(CGI.parse(req.query_string))
                  Severity: Minor
                  Found in lib/fluent/plugin/in_monitor_agent.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

                  Severity
                  Category
                  Status
                  Source
                  Language