Studiosity/grover

View on GitHub
spec/grover/middleware_spec.rb

Summary

Maintainability
A
0 mins
Test Coverage
F
33%

File middleware_spec.rb has 792 lines of code (exceeds 250 allowed). Consider refactoring.
Wontfix

require 'spec_helper'

describe Grover::Middleware do
  subject(:mock_app) do
    builder = Rack::Builder.new
Severity: Major
Found in spec/grover/middleware_spec.rb - About 1 day to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Wontfix

        describe 'png conversion' do
          let(:grover) { instance_double Grover, show_front_cover?: false, show_back_cover?: false }
    
          it 'doesnt call to Grover' do
            expect(Grover).not_to receive(:new)
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 1 other location - About 2 hrs to fix
    spec/grover/middleware_spec.rb on lines 579..601

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 95.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Wontfix

        describe 'jpeg conversion' do
          let(:grover) { instance_double Grover, show_front_cover?: false, show_back_cover?: false }
    
          it 'doesnt call to Grover' do
            expect(Grover).not_to receive(:new)
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 1 other location - About 2 hrs to fix
    spec/grover/middleware_spec.rb on lines 552..574

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 95.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Wontfix

              it 'removes JPG extension from request PATH_INFO and REQUEST_URI' do
                get 'http://www.example.org/test.jpg'
                # env state sent to downstream middleware
                expect(request_env['PATH_INFO']).to eq '/test'
                expect(request_env['REQUEST_URI']).to eq 'http://www.example.org/test'
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 4 other locations - About 1 hr to fix
    spec/grover/middleware_spec.rb on lines 126..136
    spec/grover/middleware_spec.rb on lines 140..150
    spec/grover/middleware_spec.rb on lines 189..199
    spec/grover/middleware_spec.rb on lines 234..244

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 48.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Wontfix

              it 'includes the parameters in the request URI' do
                get 'http://www.example.org/test.pdf?def=123&abc=456'
                # env state sent to downstream middleware
                expect(request_env['PATH_INFO']).to eq '/test'
                expect(request_env['REQUEST_URI']).to eq 'http://www.example.org/test?def=123&abc=456'
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 4 other locations - About 1 hr to fix
    spec/grover/middleware_spec.rb on lines 126..136
    spec/grover/middleware_spec.rb on lines 189..199
    spec/grover/middleware_spec.rb on lines 234..244
    spec/grover/middleware_spec.rb on lines 247..257

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 48.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Wontfix

              it 'removes JPEG extension from request PATH_INFO and REQUEST_URI' do
                get 'http://www.example.org/test.jpeg'
                # env state sent to downstream middleware
                expect(request_env['PATH_INFO']).to eq '/test'
                expect(request_env['REQUEST_URI']).to eq 'http://www.example.org/test'
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 4 other locations - About 1 hr to fix
    spec/grover/middleware_spec.rb on lines 126..136
    spec/grover/middleware_spec.rb on lines 140..150
    spec/grover/middleware_spec.rb on lines 189..199
    spec/grover/middleware_spec.rb on lines 247..257

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 48.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Wontfix

              it 'removes PNG extension from request PATH_INFO and REQUEST_URI' do
                get 'http://www.example.org/test.png'
                # env state sent to downstream middleware
                expect(request_env['PATH_INFO']).to eq '/test'
                expect(request_env['REQUEST_URI']).to eq 'http://www.example.org/test'
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 4 other locations - About 1 hr to fix
    spec/grover/middleware_spec.rb on lines 126..136
    spec/grover/middleware_spec.rb on lines 140..150
    spec/grover/middleware_spec.rb on lines 234..244
    spec/grover/middleware_spec.rb on lines 247..257

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 48.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Wontfix

            it 'removes PDF extension from request PATH_INFO and REQUEST_URI' do
              get 'http://www.example.org/test.pdf'
              # env state sent to downstream middleware
              expect(request_env['PATH_INFO']).to eq '/test'
              expect(request_env['REQUEST_URI']).to eq 'http://www.example.org/test'
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 4 other locations - About 1 hr to fix
    spec/grover/middleware_spec.rb on lines 140..150
    spec/grover/middleware_spec.rb on lines 189..199
    spec/grover/middleware_spec.rb on lines 234..244
    spec/grover/middleware_spec.rb on lines 247..257

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 48.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Wontfix

            it 'doesnt assign path environment variables' do
              get 'http://www.example.org/test.png'
              # env state sent to downstream middleware
              expect(request_env['PATH_INFO']).to eq '/test.png'
              expect(request_env).not_to have_key 'REQUEST_URI'
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 4 other locations - About 45 mins to fix
    spec/grover/middleware_spec.rb on lines 157..167
    spec/grover/middleware_spec.rb on lines 205..215
    spec/grover/middleware_spec.rb on lines 218..228
    spec/grover/middleware_spec.rb on lines 263..273

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 40.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 8 locations. Consider refactoring.
    Wontfix

            it 'request is ignored when the request path matches the ignore_path' do
              response = get 'http://www.example.org/baz/foo/bar/baz'
              expect(response.content_type).to eq 'text/html'
    
              response = get 'http://www.example.org/baz/foo/bar/baz.pdf'
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 7 other locations - About 45 mins to fix
    spec/grover/middleware_spec.rb on lines 698..710
    spec/grover/middleware_spec.rb on lines 738..750
    spec/grover/middleware_spec.rb on lines 775..787
    spec/grover/middleware_spec.rb on lines 790..802
    spec/grover/middleware_spec.rb on lines 811..822
    spec/grover/middleware_spec.rb on lines 847..858
    spec/grover/middleware_spec.rb on lines 873..884

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 40.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Wontfix

            it 'keeps the original PATH_INFO and not change to REQUEST_URI' do
              get 'http://www.example.org/test.html'
              # env state sent to downstream middleware
              expect(request_env['PATH_INFO']).to eq '/test.html'
              expect(request_env).not_to have_key 'REQUEST_URI'
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 4 other locations - About 45 mins to fix
    spec/grover/middleware_spec.rb on lines 157..167
    spec/grover/middleware_spec.rb on lines 173..183
    spec/grover/middleware_spec.rb on lines 205..215
    spec/grover/middleware_spec.rb on lines 218..228

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 40.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 8 locations. Consider refactoring.
    Wontfix

            it 'request is ignored when the request path starts with the ignore_path' do
              response = get 'http://www.example.org/foo/bar/baz'
              expect(response.content_type).to eq 'text/html'
    
              response = get 'http://www.example.org/foo/bar/baz.pdf'
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 7 other locations - About 45 mins to fix
    spec/grover/middleware_spec.rb on lines 698..710
    spec/grover/middleware_spec.rb on lines 738..750
    spec/grover/middleware_spec.rb on lines 775..787
    spec/grover/middleware_spec.rb on lines 790..802
    spec/grover/middleware_spec.rb on lines 829..840
    spec/grover/middleware_spec.rb on lines 847..858
    spec/grover/middleware_spec.rb on lines 873..884

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 40.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 8 locations. Consider refactoring.
    Wontfix

            it 'request is ignored when the request path passed to the proc defined in ignore_path returns true' do
              response = get 'http://www.example.org/foobazbar'
              expect(response.content_type).to eq 'text/html'
    
              response = get 'http://www.example.org/foobazbar.pdf'
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 7 other locations - About 45 mins to fix
    spec/grover/middleware_spec.rb on lines 698..710
    spec/grover/middleware_spec.rb on lines 738..750
    spec/grover/middleware_spec.rb on lines 775..787
    spec/grover/middleware_spec.rb on lines 790..802
    spec/grover/middleware_spec.rb on lines 811..822
    spec/grover/middleware_spec.rb on lines 829..840
    spec/grover/middleware_spec.rb on lines 873..884

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 40.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 8 locations. Consider refactoring.
    Wontfix

            it 'does not get stuck rendering each request as jpeg' do
              # renders html by default
              response = get 'http://www.example.org/test'
              expect(response.content_type).to eq 'text/html'
    
    
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 7 other locations - About 45 mins to fix
    spec/grover/middleware_spec.rb on lines 698..710
    spec/grover/middleware_spec.rb on lines 738..750
    spec/grover/middleware_spec.rb on lines 790..802
    spec/grover/middleware_spec.rb on lines 811..822
    spec/grover/middleware_spec.rb on lines 829..840
    spec/grover/middleware_spec.rb on lines 847..858
    spec/grover/middleware_spec.rb on lines 873..884

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 40.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Wontfix

            it 'doesnt assign path environment variables for JPEG' do
              get 'http://www.example.org/test.jpeg'
              # env state sent to downstream middleware
              expect(request_env['PATH_INFO']).to eq '/test.jpeg'
              expect(request_env).not_to have_key 'REQUEST_URI'
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 4 other locations - About 45 mins to fix
    spec/grover/middleware_spec.rb on lines 157..167
    spec/grover/middleware_spec.rb on lines 173..183
    spec/grover/middleware_spec.rb on lines 218..228
    spec/grover/middleware_spec.rb on lines 263..273

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 40.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Wontfix

            it 'doesnt assign path environment variables for JPG' do
              get 'http://www.example.org/test.jpg'
              # env state sent to downstream middleware
              expect(request_env['PATH_INFO']).to eq '/test.jpg'
              expect(request_env).not_to have_key 'REQUEST_URI'
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 4 other locations - About 45 mins to fix
    spec/grover/middleware_spec.rb on lines 157..167
    spec/grover/middleware_spec.rb on lines 173..183
    spec/grover/middleware_spec.rb on lines 205..215
    spec/grover/middleware_spec.rb on lines 263..273

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 40.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 8 locations. Consider refactoring.
    Wontfix

            it 'does not get stuck rendering each request as jpg' do
              # renders html by default
              response = get 'http://www.example.org/test'
              expect(response.content_type).to eq 'text/html'
    
    
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 7 other locations - About 45 mins to fix
    spec/grover/middleware_spec.rb on lines 698..710
    spec/grover/middleware_spec.rb on lines 738..750
    spec/grover/middleware_spec.rb on lines 775..787
    spec/grover/middleware_spec.rb on lines 811..822
    spec/grover/middleware_spec.rb on lines 829..840
    spec/grover/middleware_spec.rb on lines 847..858
    spec/grover/middleware_spec.rb on lines 873..884

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 40.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 8 locations. Consider refactoring.
    Wontfix

          it 'does not get stuck rendering each request as pdf' do
            # renders html by default
            response = get 'http://www.example.org/test'
            expect(response.content_type).to eq 'text/html'
    
    
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 7 other locations - About 45 mins to fix
    spec/grover/middleware_spec.rb on lines 738..750
    spec/grover/middleware_spec.rb on lines 775..787
    spec/grover/middleware_spec.rb on lines 790..802
    spec/grover/middleware_spec.rb on lines 811..822
    spec/grover/middleware_spec.rb on lines 829..840
    spec/grover/middleware_spec.rb on lines 847..858
    spec/grover/middleware_spec.rb on lines 873..884

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 40.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 8 locations. Consider refactoring.
    Wontfix

            it 'does not get stuck rendering each request as png' do
              # renders html by default
              response = get 'http://www.example.org/test'
              expect(response.content_type).to eq 'text/html'
    
    
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 7 other locations - About 45 mins to fix
    spec/grover/middleware_spec.rb on lines 698..710
    spec/grover/middleware_spec.rb on lines 775..787
    spec/grover/middleware_spec.rb on lines 790..802
    spec/grover/middleware_spec.rb on lines 811..822
    spec/grover/middleware_spec.rb on lines 829..840
    spec/grover/middleware_spec.rb on lines 847..858
    spec/grover/middleware_spec.rb on lines 873..884

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 40.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 8 locations. Consider refactoring.
    Wontfix

              it 'request is ignored when the request passed to the proc defined in ignore_request returns true' do
                response = get 'http://www.example.org/foobazbar'
                expect(response.content_type).to eq 'text/html'
    
                response = get 'http://www.example.org/foobazbar.pdf'
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 7 other locations - About 45 mins to fix
    spec/grover/middleware_spec.rb on lines 698..710
    spec/grover/middleware_spec.rb on lines 738..750
    spec/grover/middleware_spec.rb on lines 775..787
    spec/grover/middleware_spec.rb on lines 790..802
    spec/grover/middleware_spec.rb on lines 811..822
    spec/grover/middleware_spec.rb on lines 829..840
    spec/grover/middleware_spec.rb on lines 847..858

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 40.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Wontfix

              it 'doesnt assign path environment variables' do
                get 'http://www.example.org/test.pdf'
                # env state sent to downstream middleware
                expect(request_env['PATH_INFO']).to eq '/test.pdf'
                expect(request_env).not_to have_key 'REQUEST_URI'
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 4 other locations - About 45 mins to fix
    spec/grover/middleware_spec.rb on lines 173..183
    spec/grover/middleware_spec.rb on lines 205..215
    spec/grover/middleware_spec.rb on lines 218..228
    spec/grover/middleware_spec.rb on lines 263..273

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 40.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Wontfix

          it 'calls to the HTML preprocessor with the original HTML' do
            allow(Grover::HTMLPreprocessor).to(
              receive(:process).
                with('Grover McGroveryface', 'http://www.example.org/', 'http').
                and_return('Processed McProcessyface')
    Severity: Minor
    Found in spec/grover/middleware_spec.rb and 1 other location - About 45 mins to fix
    spec/grover/middleware_spec.rb on lines 447..458

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 39.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Wontfix

            it 'calls to the HTML preprocessor with the original HTML and the specified root_url' do
              allow(Grover::HTMLPreprocessor).to(
                receive(:process).
                  with('Grover McGroveryface', 'http://example.com/', 'http').
                  and_return('Processed McProcessyface')
    Severity: Minor
    Found in spec/grover/middleware_spec.rb and 1 other location - About 45 mins to fix
    spec/grover/middleware_spec.rb on lines 425..436

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 39.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 7 locations. Consider refactoring.
    Wontfix

            it 'matches PDF case insensitive' do
              get 'http://www.example.org/test.PDF'
              expect(last_response.headers['Content-Type']).to eq 'application/pdf'
              response_size = Grover.new('Grover McGroveryface').to_pdf.bytesize
              expect(last_response.body.bytesize).to eq response_size
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 6 other locations - About 35 mins to fix
    spec/grover/middleware_spec.rb on lines 40..45
    spec/grover/middleware_spec.rb on lines 60..65
    spec/grover/middleware_spec.rb on lines 68..73
    spec/grover/middleware_spec.rb on lines 80..85
    spec/grover/middleware_spec.rb on lines 88..93
    spec/grover/middleware_spec.rb on lines 96..101

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 36.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 7 locations. Consider refactoring.
    Wontfix

            it 'returns PNG content type' do
              get 'http://www.example.org/test.png'
              expect(last_response.headers['Content-Type']).to eq 'image/png'
              response_size = Grover.new('Grover McGroveryface').to_png.bytesize
              expect(last_response.body.bytesize).to eq response_size
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 6 other locations - About 35 mins to fix
    spec/grover/middleware_spec.rb on lines 40..45
    spec/grover/middleware_spec.rb on lines 48..53
    spec/grover/middleware_spec.rb on lines 68..73
    spec/grover/middleware_spec.rb on lines 80..85
    spec/grover/middleware_spec.rb on lines 88..93
    spec/grover/middleware_spec.rb on lines 96..101

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 36.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 7 locations. Consider refactoring.
    Wontfix

            it 'returns PDF content type' do
              get 'http://www.example.org/test.pdf'
              expect(last_response.headers['Content-Type']).to eq 'application/pdf'
              response_size = Grover.new('Grover McGroveryface').to_pdf.bytesize
              expect(last_response.body.bytesize).to eq response_size
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 6 other locations - About 35 mins to fix
    spec/grover/middleware_spec.rb on lines 48..53
    spec/grover/middleware_spec.rb on lines 60..65
    spec/grover/middleware_spec.rb on lines 68..73
    spec/grover/middleware_spec.rb on lines 80..85
    spec/grover/middleware_spec.rb on lines 88..93
    spec/grover/middleware_spec.rb on lines 96..101

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 36.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 7 locations. Consider refactoring.
    Wontfix

            it 'matches PNG case insensitive' do
              get 'http://www.example.org/test.PNG'
              expect(last_response.headers['Content-Type']).to eq 'image/png'
              response_size = Grover.new('Grover McGroveryface').to_png.bytesize
              expect(last_response.body.bytesize).to eq response_size
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 6 other locations - About 35 mins to fix
    spec/grover/middleware_spec.rb on lines 40..45
    spec/grover/middleware_spec.rb on lines 48..53
    spec/grover/middleware_spec.rb on lines 60..65
    spec/grover/middleware_spec.rb on lines 80..85
    spec/grover/middleware_spec.rb on lines 88..93
    spec/grover/middleware_spec.rb on lines 96..101

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 36.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 7 locations. Consider refactoring.
    Wontfix

            it 'matches JPEG case insensitive' do
              get 'http://www.example.org/test.JPEG'
              expect(last_response.headers['Content-Type']).to eq 'image/jpeg'
              response_size = Grover.new('Grover McGroveryface').to_jpeg.bytesize
              expect(last_response.body.bytesize).to eq response_size
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 6 other locations - About 35 mins to fix
    spec/grover/middleware_spec.rb on lines 40..45
    spec/grover/middleware_spec.rb on lines 48..53
    spec/grover/middleware_spec.rb on lines 60..65
    spec/grover/middleware_spec.rb on lines 68..73
    spec/grover/middleware_spec.rb on lines 80..85
    spec/grover/middleware_spec.rb on lines 96..101

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 36.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 7 locations. Consider refactoring.
    Wontfix

            it 'matches JPG case insensitive' do
              get 'http://www.example.org/test.JPG'
              expect(last_response.headers['Content-Type']).to eq 'image/jpeg'
              response_size = Grover.new('Grover McGroveryface').to_jpeg.bytesize
              expect(last_response.body.bytesize).to eq response_size
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 6 other locations - About 35 mins to fix
    spec/grover/middleware_spec.rb on lines 40..45
    spec/grover/middleware_spec.rb on lines 48..53
    spec/grover/middleware_spec.rb on lines 60..65
    spec/grover/middleware_spec.rb on lines 68..73
    spec/grover/middleware_spec.rb on lines 80..85
    spec/grover/middleware_spec.rb on lines 88..93

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 36.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 7 locations. Consider refactoring.
    Wontfix

            it 'returns JPEG content type' do
              get 'http://www.example.org/test.jpeg'
              expect(last_response.headers['Content-Type']).to eq 'image/jpeg'
              response_size = Grover.new('Grover McGroveryface').to_jpeg.bytesize
              expect(last_response.body.bytesize).to eq response_size
    Severity: Major
    Found in spec/grover/middleware_spec.rb and 6 other locations - About 35 mins to fix
    spec/grover/middleware_spec.rb on lines 40..45
    spec/grover/middleware_spec.rb on lines 48..53
    spec/grover/middleware_spec.rb on lines 60..65
    spec/grover/middleware_spec.rb on lines 68..73
    spec/grover/middleware_spec.rb on lines 88..93
    spec/grover/middleware_spec.rb on lines 96..101

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 36.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Wontfix

              context 'when the root_url is also set in configuration' do
                before { allow(Grover.configuration).to receive(:root_url).and_return 'http://other.domain/' }
    
                it 'uses the specified root_url in the middleware initializer' do
                  get 'http://www.example.org/test.pdf'
    Severity: Minor
    Found in spec/grover/middleware_spec.rb and 1 other location - About 25 mins to fix
    spec/grover/middleware_spec.rb on lines 488..493

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 31.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Wontfix

          context 'when request doesnt have an extension' do
            it 'returns the downstream content type' do
              get 'http://www.example.org/test'
              expect(last_response.headers['Content-Type']).to eq 'text/html'
              expect(last_response.body).to eq 'Grover McGroveryface'
    Severity: Minor
    Found in spec/grover/middleware_spec.rb and 1 other location - About 25 mins to fix
    spec/grover/middleware_spec.rb on lines 114..119

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 31.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Wontfix

            context 'with root_url set in configuration' do
              before { allow(Grover.configuration).to receive(:root_url).and_return 'http://example.com/' }
    
              it 'uses the specified root_url' do
                get 'http://www.example.org/test.pdf'
    Severity: Minor
    Found in spec/grover/middleware_spec.rb and 1 other location - About 25 mins to fix
    spec/grover/middleware_spec.rb on lines 478..483

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 31.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Wontfix

          context 'when request has a non-PDF/PNG/JPEG extension' do
            it 'returns the downstream content type' do
              get 'http://www.example.org/test.html'
              expect(last_response.headers['Content-Type']).to eq 'text/html'
              expect(last_response.body).to eq 'Grover McGroveryface'
    Severity: Minor
    Found in spec/grover/middleware_spec.rb and 1 other location - About 25 mins to fix
    spec/grover/middleware_spec.rb on lines 105..110

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 31.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Wontfix

              it 'returns response as JPEG' do
                get 'http://www.example.org/test.jpeg'
                expect(last_response.headers['Content-Type']).to eq 'image/jpeg'
                expect(last_response.body.bytesize).to eq Grover.new('Rackalicious').to_jpeg.bytesize
    Severity: Minor
    Found in spec/grover/middleware_spec.rb and 4 other locations - About 15 mins to fix
    spec/grover/middleware_spec.rb on lines 352..355
    spec/grover/middleware_spec.rb on lines 377..380
    spec/grover/middleware_spec.rb on lines 405..408
    spec/grover/middleware_spec.rb on lines 416..419

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 25.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Wontfix

            it 'returns response as PDF' do
              get 'http://www.example.org/test.pdf'
              expect(last_response.headers['Content-Type']).to eq 'application/pdf'
              expect(last_response.body.bytesize).to eq Grover.new('Rackalicious').to_pdf.bytesize
    Severity: Minor
    Found in spec/grover/middleware_spec.rb and 4 other locations - About 15 mins to fix
    spec/grover/middleware_spec.rb on lines 377..380
    spec/grover/middleware_spec.rb on lines 399..402
    spec/grover/middleware_spec.rb on lines 405..408
    spec/grover/middleware_spec.rb on lines 416..419

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 25.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Wontfix

              it 'returns response as PNG' do
                get 'http://www.example.org/test.png'
                expect(last_response.headers['Content-Type']).to eq 'image/png'
                expect(last_response.body.bytesize).to eq Grover.new('Rackalicious').to_png.bytesize
    Severity: Minor
    Found in spec/grover/middleware_spec.rb and 4 other locations - About 15 mins to fix
    spec/grover/middleware_spec.rb on lines 352..355
    spec/grover/middleware_spec.rb on lines 399..402
    spec/grover/middleware_spec.rb on lines 405..408
    spec/grover/middleware_spec.rb on lines 416..419

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 25.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Wontfix

            it 'returns response as PDF' do
              get 'http://www.example.org/test.pdf'
              expect(last_response.headers['Content-Type']).to eq 'application/pdf'
              expect(last_response.body.bytesize).to eq Grover.new('Part 1Part 2').to_pdf.bytesize
    Severity: Minor
    Found in spec/grover/middleware_spec.rb and 4 other locations - About 15 mins to fix
    spec/grover/middleware_spec.rb on lines 352..355
    spec/grover/middleware_spec.rb on lines 377..380
    spec/grover/middleware_spec.rb on lines 399..402
    spec/grover/middleware_spec.rb on lines 405..408

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 25.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Wontfix

              it 'returns response as JPG' do
                get 'http://www.example.org/test.jpg'
                expect(last_response.headers['Content-Type']).to eq 'image/jpeg'
                expect(last_response.body.bytesize).to eq Grover.new('Rackalicious').to_jpeg.bytesize
    Severity: Minor
    Found in spec/grover/middleware_spec.rb and 4 other locations - About 15 mins to fix
    spec/grover/middleware_spec.rb on lines 352..355
    spec/grover/middleware_spec.rb on lines 377..380
    spec/grover/middleware_spec.rb on lines 399..402
    spec/grover/middleware_spec.rb on lines 416..419

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 25.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status