stephancom/qrinator

View on GitHub
qrinator_spec.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Complex method describe(Qrinator)::describe(GET /*)::describe#QR generation (51.7)
Open

    describe 'QR generation' do
      let(:path) { '/some/desired/path.html' }
      let(:png) { instance_double('ChunkyPNG::Image') }
      let(:qrcoder) { instance_double('RQRCode::QRCode', to_img: png) }
      let(:payload) { base_url + path }
Severity: Minor
Found in qrinator_spec.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method describe(Qrinator)::describe(internals)::describe#download headers (48.0)
Open

    describe 'download headers' do
      subject(:headers) { qrinator.download_headers }

      it { is_expected.to match(a_hash_including('Content-Type' => 'application/octet-stream')) }
      it { is_expected.to match(a_hash_including('Pragma' => 'public')) }
Severity: Minor
Found in qrinator_spec.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method describe(Qrinator)::describe(GET /*)::describe(QR generation)::it#composites the logo (35.6)
Open

      it 'composites the logo' do
        expect(qrinator).to receive(:logo).and_return('the_logo')
        expect(png).to receive(:compose).with('the_logo', size / 3, size / 3).and_return(png)
        server.get(path)
Severity: Minor
Found in qrinator_spec.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method describe(Qrinator)::describe(GET /*)::describe(QR generation)::describe(with redis)::describe#when cached (33.6)
Open

        describe 'when cached' do
          before do
            allow(redis).to receive(:exists).with(path).and_return(true)
            allow(redis).to receive(:get).with(path).and_return(png_blob)
          end
Severity: Minor
Found in qrinator_spec.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method describe(Qrinator)::describe(GET /*)::describe(logo)::describe(with redis)::describe#when cached (33.6)
Open

        describe 'when cached' do
          before do
            allow(redis).to receive(:exists).with(logo_url).and_return(true)
            allow(redis).to receive(:get).with(logo_url).and_return(logo_blob)
          end
Severity: Minor
Found in qrinator_spec.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method describe(Qrinator)::describe(GET /*)::describe(logo)::it#returns the resized logo (30.8)
Open

      it 'returns the resized logo' do
        resized_logo = instance_double('ChunkyPNG::Image')
        expect(logo_png).to receive(:resize).with(size / 3, size / 3).and_return(resized_logo)
        expect(qrinator.logo).to eq resized_logo
Severity: Minor
Found in qrinator_spec.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method describe(Qrinator)::describe(GET /*)::describe(QR generation)::describe(with redis)::describe(when cached)::it#returns the cached image in the body (27.5)
Open

          it 'returns the cached image in the body' do
            allow(redis).to receive(:get).with(path).and_return('cached qr code')
            response = server.get(path)
            expect(response.body).to eq 'cached qr code'
Severity: Minor
Found in qrinator_spec.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method describe(Qrinator)::describe(GET /*)::describe(logo)::describe(with redis)::describe(when cached)::it#uses the cached logo (24.5)
Open

          it 'uses the cached logo' do
            allow(redis).to receive(:get).with(logo_url).and_return('cached_logo')
            expect(qrinator.raw_logo_data).to eq 'cached_logo'
Severity: Minor
Found in qrinator_spec.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method describe(Qrinator)::describe(GET /*)::describe(logo)::it#converts the raw data to a png (23.7)
Open

      it 'converts the raw data to a png' do
        expect(ChunkyPNG::Image).to receive(:from_blob).with(logo_blob).and_return(logo_png)
        expect(qrinator.logo).to be logo_png
Severity: Minor
Found in qrinator_spec.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method describe(Qrinator)::describe(GET /*)::describe(QR generation)::describe(with redis)::describe(when not cached)::it#generates with the full desired url (22.5)
Open

          it 'generates with the full desired url' do
            expect(RQRCode::QRCode).to receive(:new).with(payload, a_hash_including).and_return(qrcoder)
            server.get(path)
Severity: Minor
Found in qrinator_spec.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method describe(Qrinator)::describe(GET /*)::describe(QR generation)::describe(with redis)::describe(when cached)::it#fetches the result in the cache (22.3)
Open

          it 'fetches the result in the cache' do
            expect(redis).to receive(:get).with(path).and_return(png_blob)
            server.get(path)
Severity: Minor
Found in qrinator_spec.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method describe(Qrinator)::describe(GET /*)::describe(QR generation)::it#resizes the image (21.9)
Open

      it 'resizes the image' do
        expect(png).to receive(:resize).with(size, size).and_return(png)
        server.get(path)
Severity: Minor
Found in qrinator_spec.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method describe(Qrinator)::describe(GET /*)::describe#logo (21.8)
Open

    describe 'logo' do
      let(:logo_blob) { 'logo_png' }
      let!(:stub_get) { stub_request(:get, logo_url).to_return(body: logo_blob) }
      let(:logo_png) { instance_double('ChunkyPNG::Image') }

Severity: Minor
Found in qrinator_spec.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method describe(Qrinator)::describe(GET /*)::describe(logo)::describe(with redis)::describe(when cached)::it#fetches the result in the cache (20.5)
Open

          it 'fetches the result in the cache' do
            expect(redis).to receive(:get).with(logo_url).and_return(logo_blob)
            qrinator.raw_logo_data
Severity: Minor
Found in qrinator_spec.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method describe(Qrinator)::describe(GET /*)::describe(QR generation)::it#generates with the full desired url (20.1)
Open

      it 'generates with the full desired url' do
        expect(RQRCode::QRCode).to receive(:new).with(payload, a_hash_including).and_return(qrcoder)
        server.get(path)
Severity: Minor
Found in qrinator_spec.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

There are no issues that match your filters.

Category
Status