hannestyden/hyperspec

View on GitHub

Complex method in #resource

    def resource(path, additional_desc = nil, &block)
      describe(desc, additional_desc, &block).tap do |cls|
        cls.class_eval do
          define_method(:base_uri) do
            super().tap do |s|
Found in HyperSpec::ObjectExtensions - About 3 hrs to fix

Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

Refactorings

Read More

Complex method in #service

    def service(desc, additional_desc = nil, &block)
      describe(desc, additional_desc, &block).tap do |cls|
        cls.class_eval do
          define_method(:base_uri)     { URI.parse(desc) }
          define_method(:headers)      { {} }
Found in HyperSpec::ObjectExtensions - About 3 hrs to fix

Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

Refactorings

Read More

Complex method in #request_response

      def request_response(klass, uri, headers, body = '')
        http = Net::HTTP.new(uri.host, uri.port)
        http.use_ssl = URI::HTTPS === uri

        # NO DON'T DO IT!
Found in HyperSpec::MiniTest::SpecExtensions - About 2 hrs to fix

Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

Refactorings

Read More