orcid 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.coveralls.yml +0 -0
- data/.hound.yml +10 -0
- data/.mailmap +3 -0
- data/.travis.yml +1 -1
- data/Gemfile +1 -0
- data/README.md +39 -2
- data/app/controllers/orcid/profile_connections_controller.rb +4 -0
- data/app/controllers/orcid/profile_requests_controller.rb +5 -1
- data/app/models/orcid/profile.rb +26 -11
- data/app/models/orcid/profile_connection.rb +14 -4
- data/app/models/orcid/profile_request.rb +6 -80
- data/app/models/orcid/profile_status.rb +7 -1
- data/app/models/orcid/work/xml_renderer.rb +6 -4
- data/app/services/orcid/profile_request_coordinator.rb +112 -0
- data/app/services/orcid/remote/profile_creation_service.rb +6 -7
- data/app/services/orcid/remote/profile_query_service.rb +2 -5
- data/app/services/orcid/remote/profile_query_service/response_parser.rb +13 -7
- data/db/migrate/20140205185339_update_orcid_profile_requests.rb +6 -0
- data/lib/orcid.rb +15 -1
- data/lib/orcid/engine.rb +0 -15
- data/lib/orcid/exceptions.rb +24 -2
- data/lib/orcid/version.rb +1 -1
- data/orcid.gemspec +5 -1
- data/spec/controllers/orcid/profile_requests_controller_spec.rb +2 -2
- data/spec/features/non_ui_based_interactions_spec.rb +3 -1
- data/spec/features/orcid_work_query_spec.rb +17 -0
- data/spec/lib/orcid/exceptions_spec.rb +33 -0
- data/spec/lib/orcid_spec.rb +1 -0
- data/spec/models/orcid/profile_connection_spec.rb +8 -6
- data/spec/models/orcid/profile_request_spec.rb +9 -91
- data/spec/models/orcid/work_spec.rb +21 -0
- data/spec/services/orcid/profile_request_coordinator_spec.rb +111 -0
- data/spec/services/orcid/remote/profile_creation_service_spec.rb +17 -0
- data/spec/services/orcid/remote/profile_query_service/query_parameter_builder_spec.rb +11 -16
- data/spec/services/orcid/remote/profile_query_service_spec.rb +21 -9
- data/spec/services/orcid/remote/service_spec.rb +9 -4
- data/spec/spec_helper.rb +4 -0
- metadata +16 -5
- data/rubocop.txt +0 -1164
@@ -19,6 +19,27 @@ module Orcid
|
|
19
19
|
its(:external_identifiers) { should be_an_instance_of(Array) }
|
20
20
|
its(:valid?) { should eq true }
|
21
21
|
|
22
|
+
context '#==' do
|
23
|
+
context 'differing objects' do
|
24
|
+
it 'should not be ==' do
|
25
|
+
expect(subject == 'other').to eq(false)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
context 'same classes but different objects' do
|
29
|
+
it 'should not be ==' do
|
30
|
+
other = described_class.new
|
31
|
+
expect(subject == other).to eq(false)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
context 'same classes with same put code' do
|
35
|
+
it 'should be ==' do
|
36
|
+
other = described_class.new(put_code: 123)
|
37
|
+
subject.put_code = 123
|
38
|
+
expect(subject == other).to eq(true)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
22
43
|
context '#id' do
|
23
44
|
context 'with put_code' do
|
24
45
|
subject { described_class.new(put_code: '123') }
|
@@ -0,0 +1,111 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'orcid/profile_request_coordinator'
|
3
|
+
|
4
|
+
module Orcid
|
5
|
+
describe ProfileRequestCoordinator do
|
6
|
+
before(:each) do
|
7
|
+
profile_state_finder.stub(:call).and_yield(callback_responder)
|
8
|
+
end
|
9
|
+
Given(:logger) { double('Logger', notice: true) }
|
10
|
+
Given(:user) { 'user' }
|
11
|
+
Given(:profile_request) { double('ProfileRequest', user: user, successful_profile_creation: true, validation_error_on_profile_creation: true) }
|
12
|
+
Given(:remote_service) { double('Remote Service') }
|
13
|
+
Given(:callback_responder) do
|
14
|
+
double('Responder', unknown: true, authenticated_connection: true, profile_request_pending: true, pending_connection: true)
|
15
|
+
end
|
16
|
+
Given(:profile_state_finder) { double('ProfileStateFinder', call: true) }
|
17
|
+
Given(:coordinator) do
|
18
|
+
described_class.new(
|
19
|
+
profile_request,
|
20
|
+
remote_service: remote_service,
|
21
|
+
profile_state_finder: profile_state_finder,
|
22
|
+
logger: logger
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
context '.call' do
|
27
|
+
When(:response) do
|
28
|
+
described_class.call(
|
29
|
+
profile_request,
|
30
|
+
remote_service: remote_service,
|
31
|
+
profile_state_finder: profile_state_finder,
|
32
|
+
logger: logger
|
33
|
+
)
|
34
|
+
end
|
35
|
+
Then { expect(response).to eq(true) }
|
36
|
+
end
|
37
|
+
|
38
|
+
context 'on profile_request_pending state' do
|
39
|
+
Given(:remote_service_handler) { double('Handler', success: true, failure: true, orcid_validation_error: true) }
|
40
|
+
Given(:attributes) { { given_names: 'Given', family_name: 'Family', primary_email: 'email@email.email' } }
|
41
|
+
Given(:profile_request) do
|
42
|
+
double('ProfileRequest', user: user, attributes: attributes, successful_profile_creation: true, validation_error_on_profile_creation: true)
|
43
|
+
end
|
44
|
+
before do
|
45
|
+
callback_responder.stub(:profile_request_pending).and_yield(profile_request)
|
46
|
+
remote_service.should_receive(:call).and_yield(remote_service_handler)
|
47
|
+
end
|
48
|
+
|
49
|
+
context 'successful profile request' do
|
50
|
+
before do
|
51
|
+
remote_service_handler.should_receive(:success).and_yield(orcid_profile_id)
|
52
|
+
end
|
53
|
+
Given(:orcid_profile_id) { '0000-0001-0002-0003' }
|
54
|
+
When { coordinator.call }
|
55
|
+
Then { expect(profile_request).to have_received(:successful_profile_creation).with(orcid_profile_id) }
|
56
|
+
end
|
57
|
+
context 'encountering a orcid validation error' do
|
58
|
+
before do
|
59
|
+
remote_service_handler.should_receive(:orcid_validation_error).and_yield(error_message)
|
60
|
+
end
|
61
|
+
Given(:error_message) { 'Error Message' }
|
62
|
+
When { coordinator.call }
|
63
|
+
Then { expect(profile_request).to have_received(:validation_error_on_profile_creation).with(error_message) }
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
context 'requires a user for the profile_request' do
|
68
|
+
Given(:profile_request) { double('ProfileRequest') }
|
69
|
+
When(:instantiation) { described_class.new(profile_request) }
|
70
|
+
Then { expect(instantiation).to have_failed(MissingUserForProfileRequest) }
|
71
|
+
end
|
72
|
+
|
73
|
+
context 'requires a validation_error_on_profile_creation for the profile_request' do
|
74
|
+
Given(:profile_request) { double('ProfileRequest', user: 'user') }
|
75
|
+
When(:instantiation) { described_class.new(profile_request) }
|
76
|
+
Then { expect(instantiation).to have_failed(ProfileRequestMethodExpectedError) }
|
77
|
+
end
|
78
|
+
|
79
|
+
context 'requires a validation_error_on_profile_creation for the profile_request' do
|
80
|
+
Given(:profile_request) { double('ProfileRequest', user: 'user', validation_error_on_profile_creation: true) }
|
81
|
+
When(:instantiation) { described_class.new(profile_request) }
|
82
|
+
Then { expect(instantiation).to have_failed(ProfileRequestMethodExpectedError) }
|
83
|
+
end
|
84
|
+
|
85
|
+
context 'on unknown state' do
|
86
|
+
before do
|
87
|
+
callback_responder.stub(:unknown).and_yield
|
88
|
+
end
|
89
|
+
When(:response) { coordinator.call }
|
90
|
+
Then { expect(response).to have_failed(ProfileRequestStateError) }
|
91
|
+
end
|
92
|
+
|
93
|
+
context 'on pending_connection state' do
|
94
|
+
before do
|
95
|
+
callback_responder.stub(:pending_connection).and_yield(profile)
|
96
|
+
end
|
97
|
+
Given(:profile) { double('Profile') }
|
98
|
+
When { coordinator.call }
|
99
|
+
Then { expect(logger).to have_received(:notice) }
|
100
|
+
end
|
101
|
+
|
102
|
+
context 'on handle_authenticated_connection_for state' do
|
103
|
+
before do
|
104
|
+
callback_responder.stub(:authenticated_connection).and_yield(profile)
|
105
|
+
end
|
106
|
+
Given(:profile) { double('Profile') }
|
107
|
+
When { coordinator.call }
|
108
|
+
Then { expect(logger).to have_received(:notice) }
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
@@ -56,5 +56,22 @@ module Orcid::Remote
|
|
56
56
|
And { expect(callback.invoked).to eq [:orcid_validation_error, error_description] }
|
57
57
|
end
|
58
58
|
|
59
|
+
context 'with a remote error that is not an orcid validation error' do
|
60
|
+
before { token.should_receive(:post).and_raise(error) }
|
61
|
+
Given(:token) { double('Token') }
|
62
|
+
Given(:response) do
|
63
|
+
double(
|
64
|
+
'Response',
|
65
|
+
:body => 'Danger! Problem! Help!',
|
66
|
+
:parsed => true,
|
67
|
+
:error= => true
|
68
|
+
)
|
69
|
+
end
|
70
|
+
Given(:error) { ::OAuth2::Error.new(response) }
|
71
|
+
When(:returned_value) { described_class.call(payload, config, &callback_config) }
|
72
|
+
Then { expect(returned_value).to have_failed }
|
73
|
+
And { expect(callback.invoked).to be_nil }
|
74
|
+
end
|
75
|
+
|
59
76
|
end
|
60
77
|
end
|
@@ -6,37 +6,32 @@ module Orcid::Remote
|
|
6
6
|
describe ProfileQueryService::QueryParameterBuilder do
|
7
7
|
When(:response) { described_class.call(input) }
|
8
8
|
context 'single word input' do
|
9
|
-
Given(:input) {
|
10
|
-
{ text: "Hello", email: 'jeremy.n.friesen@gmail.com' }
|
11
|
-
}
|
9
|
+
Given(:input) { { text: 'Hello', email: 'jeremy.n.friesen@gmail.com' } }
|
12
10
|
Then { expect(response).to eq(q: "email:#{input[:email]} AND text:#{input[:text]}") }
|
13
11
|
end
|
14
12
|
|
15
13
|
context 'empty string and nil' do
|
16
|
-
Given(:input) {
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
Given(:input) { { text: '' , email: nil } }
|
15
|
+
Then { expect(response).to eq(q: '') }
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'start or row' do
|
19
|
+
Given(:input) { { start: '1' , row: '2' } }
|
20
|
+
Then { expect(response).to eq(q: '', start: '1', row: '2') }
|
20
21
|
end
|
21
22
|
|
22
23
|
context 'multi-word named input' do
|
23
|
-
Given(:input) {
|
24
|
-
{ other_names: %("Tim O'Connor" -"Oak"), email: 'jeremy.n.friesen@gmail.com' }
|
25
|
-
}
|
24
|
+
Given(:input) { { other_names: %("Tim O'Connor" -"Oak"), email: 'jeremy.n.friesen@gmail.com' } }
|
26
25
|
Then { expect(response).to eq(q: "other-names:#{input[:other_names]} AND email:#{input[:email]}") }
|
27
26
|
end
|
28
27
|
|
29
28
|
context 'q is provided along with other params' do
|
30
|
-
Given(:input) {
|
31
|
-
{ q: %("Tim O'Connor" -"Oak"), email: 'jeremy.n.friesen@gmail.com' }
|
32
|
-
}
|
29
|
+
Given(:input) { { q: %("Tim O'Connor" -"Oak"), email: 'jeremy.n.friesen@gmail.com' } }
|
33
30
|
Then { expect(response).to eq(q: "email:#{input[:email]} AND text:#{input[:q]}") }
|
34
31
|
end
|
35
32
|
|
36
33
|
context 'q is provided with text params' do
|
37
|
-
Given(:input) {
|
38
|
-
{ q: %("Tim O'Connor" -"Oak"), text: 'jeremy.n.friesen@gmail.com' }
|
39
|
-
}
|
34
|
+
Given(:input) { { q: %("Tim O'Connor" -"Oak"), text: 'jeremy.n.friesen@gmail.com' } }
|
40
35
|
Then { expect(response).to eq(q: "text:((#{input[:q]}) AND (#{input[:text]}))") }
|
41
36
|
end
|
42
37
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'spec_helper'
|
2
2
|
require 'orcid/remote/profile_query_service'
|
3
3
|
require 'ostruct'
|
4
4
|
|
@@ -8,8 +8,6 @@ module Orcid::Remote
|
|
8
8
|
Given(:config) {
|
9
9
|
{
|
10
10
|
token: token,
|
11
|
-
path: 'somehwere',
|
12
|
-
headers: 'headers',
|
13
11
|
parser: parser,
|
14
12
|
query_parameter_builder: query_parameter_builder
|
15
13
|
}
|
@@ -24,13 +22,27 @@ module Orcid::Remote
|
|
24
22
|
Given(:parsed_response) { 'HELLO WORLD!' }
|
25
23
|
|
26
24
|
context '.call' do
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
context 'with at least one found' do
|
26
|
+
before(:each) do
|
27
|
+
query_parameter_builder.should_receive(:call).with(parameters).and_return(normalized_parameters)
|
28
|
+
token.should_receive(:get).with(kind_of(String), headers: kind_of(Hash), params: normalized_parameters).and_return(response)
|
29
|
+
end
|
30
|
+
When(:result) { described_class.call(parameters, config, &callback_config) }
|
31
|
+
Then { expect(result).to eq(parsed_response) }
|
32
|
+
And { expect(callback.invoked).to eq [:found, parsed_response] }
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'with no objects found' do
|
36
|
+
before(:each) do
|
37
|
+
query_parameter_builder.should_receive(:call).with(parameters).and_return(normalized_parameters)
|
38
|
+
token.should_receive(:get).with(kind_of(String), headers: kind_of(Hash), params: normalized_parameters).and_return(response)
|
39
|
+
end
|
40
|
+
When(:parsed_response) { '' }
|
41
|
+
When(:result) { described_class.call(parameters, config, &callback_config) }
|
42
|
+
Then { expect(result).to eq(parsed_response) }
|
43
|
+
And { expect(callback.invoked).to eq [:not_found] }
|
44
|
+
|
30
45
|
end
|
31
|
-
When(:result) { described_class.call(parameters, config, &callback_config) }
|
32
|
-
Then { expect(result).to eq(parsed_response) }
|
33
|
-
And { expect(callback.invoked).to eq [:found, parsed_response] }
|
34
46
|
end
|
35
47
|
end
|
36
48
|
end
|
@@ -6,21 +6,26 @@ module Orcid::Remote
|
|
6
6
|
Given(:context) { double(invoked: true) }
|
7
7
|
Given(:runner) {
|
8
8
|
described_class.new { |on|
|
9
|
-
on.found {|a,b| context.invoked(
|
9
|
+
on.found { |a,b| context.invoked('FOUND', a, b) }
|
10
10
|
}
|
11
11
|
}
|
12
12
|
|
13
|
-
describe
|
13
|
+
describe 'calling defined callback' do
|
14
14
|
When(:result) { runner.callback(:found, :first, :second) }
|
15
|
-
Then { context.should have_received(:invoked).with(
|
15
|
+
Then { context.should have_received(:invoked).with('FOUND', :first, :second) }
|
16
16
|
Then { result == [:first, :second] }
|
17
17
|
end
|
18
18
|
|
19
|
-
describe
|
19
|
+
describe 'calling undefined callback' do
|
20
20
|
When(:result) { runner.callback(:missing, :first, :second) }
|
21
21
|
Then { context.should_not have_received(:invoked) }
|
22
22
|
Then { result == [:first, :second] }
|
23
23
|
end
|
24
24
|
|
25
|
+
describe 'call' do
|
26
|
+
When(:response) { runner.call }
|
27
|
+
Then { expect(response).to have_failed(NotImplementedError) }
|
28
|
+
end
|
29
|
+
|
25
30
|
end
|
26
31
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orcid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Friesen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -297,8 +297,10 @@ executables: []
|
|
297
297
|
extensions: []
|
298
298
|
extra_rdoc_files: []
|
299
299
|
files:
|
300
|
+
- .coveralls.yml
|
300
301
|
- .gitignore
|
301
302
|
- .hound.yml
|
303
|
+
- .mailmap
|
302
304
|
- .travis.yml
|
303
305
|
- CONTRIBUTING.md
|
304
306
|
- Gemfile
|
@@ -318,6 +320,7 @@ files:
|
|
318
320
|
- app/models/orcid/work.rb
|
319
321
|
- app/models/orcid/work/xml_parser.rb
|
320
322
|
- app/models/orcid/work/xml_renderer.rb
|
323
|
+
- app/services/orcid/profile_request_coordinator.rb
|
321
324
|
- app/services/orcid/remote.rb
|
322
325
|
- app/services/orcid/remote/profile_creation_service.rb
|
323
326
|
- app/services/orcid/remote/profile_query_service.rb
|
@@ -341,6 +344,7 @@ files:
|
|
341
344
|
- config/locales/orcid.en.yml
|
342
345
|
- config/routes.rb
|
343
346
|
- db/migrate/20140205185338_create_orcid_profile_requests.rb
|
347
|
+
- db/migrate/20140205185339_update_orcid_profile_requests.rb
|
344
348
|
- lib/generators/orcid/install/install_generator.rb
|
345
349
|
- lib/generators/orcid/install/templates/orcid_initializer.rb.erb
|
346
350
|
- lib/orcid.rb
|
@@ -353,7 +357,6 @@ files:
|
|
353
357
|
- lib/orcid/version.rb
|
354
358
|
- lib/tasks/orcid_tasks.rake
|
355
359
|
- orcid.gemspec
|
356
|
-
- rubocop.txt
|
357
360
|
- script/fast_specs
|
358
361
|
- spec/controllers/orcid/profile_connections_controller_spec.rb
|
359
362
|
- spec/controllers/orcid/profile_requests_controller_spec.rb
|
@@ -362,6 +365,7 @@ files:
|
|
362
365
|
- spec/fast_helper.rb
|
363
366
|
- spec/features/batch_profile_spec.rb
|
364
367
|
- spec/features/non_ui_based_interactions_spec.rb
|
368
|
+
- spec/features/orcid_work_query_spec.rb
|
365
369
|
- spec/features/profile_connection_feature_spec.rb
|
366
370
|
- spec/features/public_api_query_spec.rb
|
367
371
|
- spec/fixtures/orcid-remote-profile_query_service-response_parser/multiple-responses-without-valid-response.json
|
@@ -369,6 +373,7 @@ files:
|
|
369
373
|
- spec/fixtures/orcid_works.xml
|
370
374
|
- spec/lib/orcid/configuration/provider_spec.rb
|
371
375
|
- spec/lib/orcid/configuration_spec.rb
|
376
|
+
- spec/lib/orcid/exceptions_spec.rb
|
372
377
|
- spec/lib/orcid/named_callbacks_spec.rb
|
373
378
|
- spec/lib/orcid_spec.rb
|
374
379
|
- spec/models/orcid/profile_connection_spec.rb
|
@@ -379,6 +384,7 @@ files:
|
|
379
384
|
- spec/models/orcid/work/xml_renderer_spec.rb
|
380
385
|
- spec/models/orcid/work_spec.rb
|
381
386
|
- spec/routing/orcid/profile_request_routing_spec.rb
|
387
|
+
- spec/services/orcid/profile_request_coordinator_spec.rb
|
382
388
|
- spec/services/orcid/remote/profile_creation_service_spec.rb
|
383
389
|
- spec/services/orcid/remote/profile_query_service/query_parameter_builder_spec.rb
|
384
390
|
- spec/services/orcid/remote/profile_query_service/response_parser_spec.rb
|
@@ -398,9 +404,11 @@ files:
|
|
398
404
|
- spec/views/orcid/profile_connections/_profile_request_pending.html.erb_spec.rb
|
399
405
|
- spec/views/orcid/profile_connections/new.html.erb_spec.rb
|
400
406
|
- spec/views/orcid/profile_requests/new.html.erb_spec.rb
|
401
|
-
homepage: https://github.com/
|
407
|
+
homepage: https://github.com/projecthydra-labs/orcid
|
402
408
|
licenses: []
|
403
|
-
metadata:
|
409
|
+
metadata:
|
410
|
+
source: https://github.com/projecthydra-labs/orcid
|
411
|
+
issue_tracker: https://github.com/projecthydra-labs/orcid/issues
|
404
412
|
post_install_message:
|
405
413
|
rdoc_options: []
|
406
414
|
require_paths:
|
@@ -429,6 +437,7 @@ test_files:
|
|
429
437
|
- spec/fast_helper.rb
|
430
438
|
- spec/features/batch_profile_spec.rb
|
431
439
|
- spec/features/non_ui_based_interactions_spec.rb
|
440
|
+
- spec/features/orcid_work_query_spec.rb
|
432
441
|
- spec/features/profile_connection_feature_spec.rb
|
433
442
|
- spec/features/public_api_query_spec.rb
|
434
443
|
- spec/fixtures/orcid-remote-profile_query_service-response_parser/multiple-responses-without-valid-response.json
|
@@ -436,6 +445,7 @@ test_files:
|
|
436
445
|
- spec/fixtures/orcid_works.xml
|
437
446
|
- spec/lib/orcid/configuration/provider_spec.rb
|
438
447
|
- spec/lib/orcid/configuration_spec.rb
|
448
|
+
- spec/lib/orcid/exceptions_spec.rb
|
439
449
|
- spec/lib/orcid/named_callbacks_spec.rb
|
440
450
|
- spec/lib/orcid_spec.rb
|
441
451
|
- spec/models/orcid/profile_connection_spec.rb
|
@@ -446,6 +456,7 @@ test_files:
|
|
446
456
|
- spec/models/orcid/work/xml_renderer_spec.rb
|
447
457
|
- spec/models/orcid/work_spec.rb
|
448
458
|
- spec/routing/orcid/profile_request_routing_spec.rb
|
459
|
+
- spec/services/orcid/profile_request_coordinator_spec.rb
|
449
460
|
- spec/services/orcid/remote/profile_creation_service_spec.rb
|
450
461
|
- spec/services/orcid/remote/profile_query_service/query_parameter_builder_spec.rb
|
451
462
|
- spec/services/orcid/remote/profile_query_service/response_parser_spec.rb
|
data/rubocop.txt
DELETED
@@ -1,1164 +0,0 @@
|
|
1
|
-
Inspecting 93 files
|
2
|
-
.....CC...C.C..C..C....C.CCWCWCCCC.WCWCCCCC....W...C.C...WC..CC..C.C..CCCCCCCCCCCCCCCCCCCWC..
|
3
|
-
|
4
|
-
Offenses:
|
5
|
-
|
6
|
-
app/models/orcid/profile_request.rb:76:5: C: Method has too many lines. [21/10]
|
7
|
-
def xml_payload(input = attributes)
|
8
|
-
^^^
|
9
|
-
app/models/orcid/profile_request.rb:81:141: C: Line is too long. [149/140]
|
10
|
-
xmlns:xsi="http://www.orcid.org/ns/orcid https://raw.github.com/ORCID/ORCID-Source/master/orcid-model/src/main/resources/orcid-message-1.1.xsd"
|
11
|
-
^^^^^^^^^
|
12
|
-
app/models/orcid/work/xml_parser.rb:27:7: C: Method has too many lines. [14/10]
|
13
|
-
def transform(node)
|
14
|
-
^^^
|
15
|
-
app/services/orcid/remote/profile_query_service/query_parameter_builder.rb:7:1: C: Extra empty line detected at body beginning.
|
16
|
-
app/services/orcid/remote/profile_query_service/query_parameter_builder.rb:14:9: C: Cyclomatic complexity for call is too high. [7/6]
|
17
|
-
def call(input = {})
|
18
|
-
^^^
|
19
|
-
app/services/orcid/remote/profile_query_service/query_parameter_builder.rb:14:9: C: Method has too many lines. [23/10]
|
20
|
-
def call(input = {})
|
21
|
-
^^^
|
22
|
-
app/services/orcid/remote/profile_query_service.rb:56:7: C: Method has too many lines. [20/10]
|
23
|
-
def parse(document)
|
24
|
-
^^^
|
25
|
-
app/services/orcid/remote/profile_query_service.rb:69:59: C: Space between { and | missing.
|
26
|
-
emails = (contact_details['email'] || []).map {|email| email.fetch('value') }
|
27
|
-
^^
|
28
|
-
app/services/orcid/remote/profile_query_service.rb:79:1: C: Extra empty line detected at body end.
|
29
|
-
app/services/orcid/remote.rb:2:3: C: Missing top-level module documentation comment.
|
30
|
-
module Remote
|
31
|
-
^^^^^^
|
32
|
-
app/services/orcid/remote.rb:4:4: C: Final newline missing.
|
33
|
-
end
|
34
|
-
|
35
|
-
db/migrate/20140205185338_create_orcid_profile_requests.rb:1:1: C: Missing top-level class documentation comment.
|
36
|
-
class CreateOrcidProfileRequests < ActiveRecord::Migration
|
37
|
-
^^^^^
|
38
|
-
lib/orcid/exceptions.rb:2:1: C: Extra empty line detected at body beginning.
|
39
|
-
lib/orcid/exceptions.rb:3:3: C: Missing top-level class documentation comment.
|
40
|
-
class ConfigurationError < RuntimeError
|
41
|
-
^^^^^
|
42
|
-
lib/orcid/exceptions.rb:14:15: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
43
|
-
text << "-- Client --"
|
44
|
-
^^^^^^^^^^^^^^
|
45
|
-
lib/orcid/spec_support.rb:2:1: C: Missing top-level class documentation comment.
|
46
|
-
class RequestSandboxAuthorizationCode
|
47
|
-
^^^^^
|
48
|
-
lib/orcid/spec_support.rb:3:1: C: Extra empty line detected at body beginning.
|
49
|
-
lib/orcid/spec_support.rb:52:35: C: Redundant curly braces around a hash parameter.
|
50
|
-
RestClient.get(authorize_url, { params: parameters, cookies: cookies })
|
51
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
52
|
-
lib/orcid/spec_support.rb:57:53: C: Redundant curly braces around a hash parameter.
|
53
|
-
authorize_url, { user_oauth_approval: true }, { cookies: cookies }
|
54
|
-
^^^^^^^^^^^^^^^^^^^^
|
55
|
-
lib/orcid/spec_support.rb:63:1: C: Extra empty line detected at body end.
|
56
|
-
lib/orcid/version.rb:1:1: C: Missing top-level module documentation comment.
|
57
|
-
module Orcid
|
58
|
-
^^^^^^
|
59
|
-
lib/orcid.rb:13:1: C: Missing top-level module documentation comment.
|
60
|
-
module Orcid
|
61
|
-
^^^^^^
|
62
|
-
lib/orcid.rb:14:1: C: Extra empty line detected at body beginning.
|
63
|
-
lib/orcid.rb:62:13: W: Assignment in condition - you probably meant to use ==.
|
64
|
-
if auth = authentication_model.where(provider: 'orcid', user: user).first
|
65
|
-
^
|
66
|
-
lib/orcid.rb:85:1: C: Extra empty line detected at body end.
|
67
|
-
orcid.gemspec:1:1: C: Prefer $LOAD_PATH over $:.
|
68
|
-
$:.push File.expand_path("../lib", __FILE__)
|
69
|
-
^^
|
70
|
-
orcid.gemspec:1:26: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
71
|
-
$:.push File.expand_path("../lib", __FILE__)
|
72
|
-
^^^^^^^^
|
73
|
-
orcid.gemspec:21:34: C: Use %r only for regular expressions matching more than 1 '/' character.
|
74
|
-
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
75
|
-
^^^^^^^^^
|
76
|
-
orcid.gemspec:22:34: C: Use %r only for regular expressions matching more than 1 '/' character.
|
77
|
-
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
78
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
79
|
-
orcid.gemspec:23:22: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
80
|
-
s.require_paths = ["lib"]
|
81
|
-
^^^^^
|
82
|
-
Rakefile:9:1: C: Extra blank line detected.
|
83
|
-
Rakefile:11:35: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
84
|
-
APP_RAKEFILE = File.expand_path("../spec/internal/Rakefile", __FILE__)
|
85
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
86
|
-
Rakefile:21:39: W: Unused block argument - t. You can omit the argument if you don't care about it.
|
87
|
-
RSpec::Core::RakeTask.new(:all) do |t|
|
88
|
-
^
|
89
|
-
Rakefile:26:20: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
90
|
-
t.rspec_opts = "--tag ~requires_net_connect"
|
91
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
92
|
-
Rakefile:31:20: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
93
|
-
t.rspec_opts = "--tag requires_net_connect"
|
94
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
95
|
-
Rakefile:37:24: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
96
|
-
ENV['SPEC_OPTS'] = "--profile 20"
|
97
|
-
^^^^^^^^^^^^^^
|
98
|
-
Rakefile:45:1: C: Avoid using rescue in its modifier form.
|
99
|
-
Rake::Task["default"].clear rescue nil
|
100
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
101
|
-
Rakefile:45:12: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
102
|
-
Rake::Task["default"].clear rescue nil
|
103
|
-
^^^^^^^^^
|
104
|
-
Rakefile:46:12: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
105
|
-
Rake::Task["spec"].clear
|
106
|
-
^^^^^^
|
107
|
-
Rakefile:48:6: C: Use the new Ruby 1.9 hash syntax.
|
108
|
-
task :spec => 'spec:offline'
|
109
|
-
^^^^^^^^
|
110
|
-
Rakefile:49:6: C: Use the new Ruby 1.9 hash syntax.
|
111
|
-
task :default => 'spec:travis'
|
112
|
-
^^^^^^^^^^^
|
113
|
-
Rakefile:49:31: C: Final newline missing.
|
114
|
-
task :default => 'spec:travis'
|
115
|
-
|
116
|
-
script/fast_specs:5:1: C: Missing top-level module documentation comment.
|
117
|
-
module Fast
|
118
|
-
^^^^^^
|
119
|
-
script/fast_specs:12:51: C: Avoid using {...} for multi-line blocks.
|
120
|
-
fast_specs = FileList['spec/**/*_spec.rb'].select { |fn|
|
121
|
-
^
|
122
|
-
script/fast_specs:18:8: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
123
|
-
puts "Unable to find any fast specs"
|
124
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
125
|
-
spec/controllers/orcid/profile_connections_controller_spec.rb:3:1: C: Missing top-level module documentation comment.
|
126
|
-
module Orcid
|
127
|
-
^^^^^^
|
128
|
-
spec/controllers/orcid/profile_connections_controller_spec.rb:14:5: C: Method has too many lines. [12/10]
|
129
|
-
def self.it_redirects_if_user_has_previously_connected_to_orcid_profile(method, action)
|
130
|
-
^^^
|
131
|
-
spec/controllers/orcid/profile_connections_controller_spec.rb:18:34: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
132
|
-
orcid_profile = double("Orcid::Profile", orcid_profile_id: '1234-5678-0001-0002')
|
133
|
-
^^^^^^^^^^^^^^^^
|
134
|
-
spec/controllers/orcid/profile_connections_controller_spec.rb:25:20: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
135
|
-
I18n.t("orcid.requests.messages.previously_connected_profile", orcid_profile_id: orcid_profile.orcid_profile_id)
|
136
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
137
|
-
spec/controllers/orcid/profile_connections_controller_spec.rb:42:45: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
138
|
-
expect(flash[:notice]).to eq(I18n.t("orcid.connections.messages.profile_connection_not_found"))
|
139
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
140
|
-
spec/controllers/orcid/profile_connections_controller_spec.rb:48:32: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
141
|
-
orcid_profile = double("Orcid::Profile", orcid_profile_id: '1234-5678-0001-0002', verified_authentication?: false)
|
142
|
-
^^^^^^^^^^^^^^^^
|
143
|
-
spec/controllers/orcid/profile_connections_controller_spec.rb:52:69: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
144
|
-
expect(response).to redirect_to(user_omniauth_authorize_url("orcid"))
|
145
|
-
^^^^^^^
|
146
|
-
spec/controllers/orcid/profile_connections_controller_spec.rb:57:32: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
147
|
-
orcid_profile = double("Orcid::Profile", orcid_profile_id: '1234-5678-0001-0002', verified_authentication?: true)
|
148
|
-
^^^^^^^^^^^^^^^^
|
149
|
-
spec/controllers/orcid/profile_connections_controller_spec.rb:63:45: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
150
|
-
expect(flash[:notice]).to eq(I18n.t("orcid.connections.messages.verified_profile_connection_exists", orcid_profile_id: orcid_profile.orcid_profile_id))
|
151
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
152
|
-
spec/controllers/orcid/profile_connections_controller_spec.rb:63:141: C: Line is too long. [159/140]
|
153
|
-
expect(flash[:notice]).to eq(I18n.t("orcid.connections.messages.verified_profile_connection_exists", orcid_profile_id: orcid_profile.orcid_profile_id))
|
154
|
-
^^^^^^^^^^^^^^^^^^^
|
155
|
-
spec/controllers/orcid/profile_connections_controller_spec.rb:88:33: C: Space missing inside {.
|
156
|
-
let(:orcid_profile_id) {'0000-0001-8025-637X'}
|
157
|
-
^
|
158
|
-
spec/controllers/orcid/profile_connections_controller_spec.rb:88:54: C: Space missing inside }.
|
159
|
-
let(:orcid_profile_id) {'0000-0001-8025-637X'}
|
160
|
-
^
|
161
|
-
spec/controllers/orcid/profile_requests_controller_spec.rb:3:1: C: Missing top-level module documentation comment.
|
162
|
-
module Orcid
|
163
|
-
^^^^^^
|
164
|
-
spec/controllers/orcid/profile_requests_controller_spec.rb:7:12: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
165
|
-
it "should redirect for sign in" do
|
166
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
167
|
-
spec/controllers/orcid/profile_requests_controller_spec.rb:14:5: C: Method has too many lines. [12/10]
|
168
|
-
def self.it_redirects_if_user_has_previously_connected_to_orcid_profile(method, action)
|
169
|
-
^^^
|
170
|
-
spec/controllers/orcid/profile_requests_controller_spec.rb:18:34: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
171
|
-
orcid_profile = double("Orcid::Profile", orcid_profile_id: '1234-5678-0001-0002')
|
172
|
-
^^^^^^^^^^^^^^^^
|
173
|
-
spec/controllers/orcid/profile_requests_controller_spec.rb:25:20: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
174
|
-
I18n.t("orcid.requests.messages.previously_connected_profile", orcid_profile_id: orcid_profile.orcid_profile_id)
|
175
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
176
|
-
spec/controllers/orcid/profile_requests_controller_spec.rb:42:94: C: Space missing inside }.
|
177
|
-
let(:profile_request) { FactoryGirl.build_stubbed(:orcid_profile_request, user: user)}
|
178
|
-
^
|
179
|
-
spec/controllers/orcid/profile_requests_controller_spec.rb:45:62: C: Place the . on the next line, together with the method name.
|
180
|
-
Orcid::ProfileRequest.should_receive(:find_by_user).
|
181
|
-
^
|
182
|
-
spec/controllers/orcid/profile_requests_controller_spec.rb:56:62: C: Place the . on the next line, together with the method name.
|
183
|
-
Orcid::ProfileRequest.should_receive(:find_by_user).
|
184
|
-
^
|
185
|
-
spec/controllers/orcid/profile_requests_controller_spec.rb:61:47: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
186
|
-
expect(flash[:notice]).to eq(I18n.t("orcid.requests.messages.existing_request_not_found"))
|
187
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
188
|
-
spec/controllers/orcid/profile_requests_controller_spec.rb:85:47: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
189
|
-
expect(flash[:notice]).to eq(I18n.t("orcid.requests.messages.existing_request"))
|
190
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
191
|
-
spec/controllers/orcid/profile_requests_controller_spec.rb:109:47: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
192
|
-
expect(flash[:notice]).to eq(I18n.t("orcid.requests.messages.existing_request"))
|
193
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
194
|
-
spec/factories/orcid_profile_requests.rb:4:35: C: Use the new Ruby 1.9 hash syntax.
|
195
|
-
factory :orcid_profile_request, :class => 'Orcid::ProfileRequest' do
|
196
|
-
^^^^^^^^^
|
197
|
-
spec/fast_helper.rb:2:22: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
198
|
-
Dir[File.expand_path("../../app/*", __FILE__)].each do |dir|
|
199
|
-
^^^^^^^^^^^^^
|
200
|
-
spec/fast_helper.rb:5:32: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
201
|
-
$LOAD_PATH << File.expand_path("../../lib", __FILE__)
|
202
|
-
^^^^^^^^^^^
|
203
|
-
spec/fast_helper.rb:10:13: W: Ambiguous splat operator. Parenthesize the method arguments if it's surely a splat operator, or add a whitespace to the right of the * if it should be a multiplication.
|
204
|
-
require *files
|
205
|
-
^
|
206
|
-
spec/features/batch_profile_spec.rb:10:18: C: Avoid using {...} for multi-line blocks.
|
207
|
-
Given(:runner) {
|
208
|
-
^
|
209
|
-
spec/features/batch_profile_spec.rb:11:12: C: Avoid using {...} for multi-line blocks.
|
210
|
-
lambda { |person|
|
211
|
-
^
|
212
|
-
spec/features/batch_profile_spec.rb:12:46: C: Avoid using {...} for multi-line blocks.
|
213
|
-
Orcid::Remote::ProfileQueryService.new {|on|
|
214
|
-
^
|
215
|
-
spec/features/batch_profile_spec.rb:13:18: C: Space between { and | missing.
|
216
|
-
on.found {|results| person.found(results) }
|
217
|
-
^^
|
218
|
-
spec/features/batch_profile_spec.rb:18:18: C: Avoid using {...} for multi-line blocks.
|
219
|
-
Given(:person) {
|
220
|
-
^
|
221
|
-
spec/features/non_ui_based_interactions_spec.rb:5:21: C: Space between { and | missing.
|
222
|
-
Mappy.configure {|b|}
|
223
|
-
^^
|
224
|
-
spec/features/non_ui_based_interactions_spec.rb:5:23: W: Unused block argument - b. You can omit the argument if you don't care about it.
|
225
|
-
Mappy.configure {|b|}
|
226
|
-
^
|
227
|
-
spec/features/non_ui_based_interactions_spec.rb:5:25: C: Space missing inside }.
|
228
|
-
Mappy.configure {|b|}
|
229
|
-
^
|
230
|
-
spec/features/non_ui_based_interactions_spec.rb:12:39: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
231
|
-
let(:work) { Orcid::Work.new(title: "Test Driven Orcid Integration", work_type: 'test') }
|
232
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
233
|
-
spec/features/non_ui_based_interactions_spec.rb:21:27: C: Avoid using {...} for multi-line blocks.
|
234
|
-
let(:profile_request) {
|
235
|
-
^
|
236
|
-
spec/features/non_ui_based_interactions_spec.rb:51:67: C: Space missing inside }.
|
237
|
-
let(:orcid_profile_id) { ENV.fetch('ORCID_CLAIMED_PROFILE_ID')}
|
238
|
-
^
|
239
|
-
spec/features/non_ui_based_interactions_spec.rb:52:79: C: Space missing inside }.
|
240
|
-
let(:orcid_profile_password) { ENV.fetch('ORCID_CLAIMED_PROFILE_PASSWORD')}
|
241
|
-
^
|
242
|
-
spec/features/non_ui_based_interactions_spec.rb:61:49: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
243
|
-
replacement_work = Orcid::Work.new(title: "Test Driven Orcid Integration", work_type: 'test')
|
244
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
245
|
-
spec/features/non_ui_based_interactions_spec.rb:62:46: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
246
|
-
appended_work = Orcid::Work.new(title: "Another Test Drive", work_type: 'test')
|
247
|
-
^^^^^^^^^^^^^^^^^^^^
|
248
|
-
spec/features/non_ui_based_interactions_spec.rb:66:14: C: Avoid using {...} for multi-line blocks.
|
249
|
-
expect {
|
250
|
-
^
|
251
|
-
spec/features/non_ui_based_interactions_spec.rb:77:24: C: Space inside { missing.
|
252
|
-
normalized_token = {provider: 'orcid', uid: orcid_profile_id, credentials: {token: token.token, refresh_token: token.refresh_token }}
|
253
|
-
^
|
254
|
-
spec/features/non_ui_based_interactions_spec.rb:77:80: C: Space inside { missing.
|
255
|
-
normalized_token = {provider: 'orcid', uid: orcid_profile_id, credentials: {token: token.token, refresh_token: token.refresh_token }}
|
256
|
-
^
|
257
|
-
spec/features/non_ui_based_interactions_spec.rb:77:137: C: Space inside } missing.
|
258
|
-
normalized_token = {provider: 'orcid', uid: orcid_profile_id, credentials: {token: token.token, refresh_token: token.refresh_token }}
|
259
|
-
^
|
260
|
-
spec/features/non_ui_based_interactions_spec.rb:82:3: C: Method has too many lines. [28/10]
|
261
|
-
def claim_the_orcid!(email_prefix)
|
262
|
-
^^^
|
263
|
-
spec/features/non_ui_based_interactions_spec.rb:101:36: C: Prefer map over collect.
|
264
|
-
href = page.all('.mailview a').collect { |a| a[:href] }.find {|href| href = /\/claim\//}
|
265
|
-
^^^^^^^
|
266
|
-
spec/features/non_ui_based_interactions_spec.rb:101:66: C: Space between { and | missing.
|
267
|
-
href = page.all('.mailview a').collect { |a| a[:href] }.find {|href| href = /\/claim\//}
|
268
|
-
^^
|
269
|
-
spec/features/non_ui_based_interactions_spec.rb:101:68: W: Shadowing outer local variable - href.
|
270
|
-
href = page.all('.mailview a').collect { |a| a[:href] }.find {|href| href = /\/claim\//}
|
271
|
-
^^^^
|
272
|
-
spec/features/non_ui_based_interactions_spec.rb:101:68: W: Unused block argument - href. You can omit the argument if you don't care about it.
|
273
|
-
href = page.all('.mailview a').collect { |a| a[:href] }.find {|href| href = /\/claim\//}
|
274
|
-
^^^^
|
275
|
-
spec/features/non_ui_based_interactions_spec.rb:101:74: W: Useless assignment to variable - href.
|
276
|
-
href = page.all('.mailview a').collect { |a| a[:href] }.find {|href| href = /\/claim\//}
|
277
|
-
^^^^
|
278
|
-
spec/features/non_ui_based_interactions_spec.rb:101:81: C: Use %r for regular expressions matching more than 1 '/' character.
|
279
|
-
href = page.all('.mailview a').collect { |a| a[:href] }.find {|href| href = /\/claim\//}
|
280
|
-
^^^^^^^^^^^
|
281
|
-
spec/features/non_ui_based_interactions_spec.rb:101:92: C: Space missing inside }.
|
282
|
-
href = page.all('.mailview a').collect { |a| a[:href] }.find {|href| href = /\/claim\//}
|
283
|
-
^
|
284
|
-
spec/features/non_ui_based_interactions_spec.rb:114:29: C: Space between { and | missing.
|
285
|
-
page.all('button').find {|i| i.text == 'Claim' }.click
|
286
|
-
^^
|
287
|
-
spec/features/profile_connection_feature_spec.rb:3:1: C: Missing top-level module documentation comment.
|
288
|
-
module Orcid
|
289
|
-
^^^^^^
|
290
|
-
spec/features/public_api_query_spec.rb:10:18: C: Avoid using {...} for multi-line blocks.
|
291
|
-
Given(:runner) {
|
292
|
-
^
|
293
|
-
spec/features/public_api_query_spec.rb:32:35: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
294
|
-
Given(:parameters) { { email: "nobody@gmail.com", text: '"Jeremy+Friesen"' } }
|
295
|
-
^^^^^^^^^^^^^^^^^^
|
296
|
-
spec/internal/app/controllers/application_controller.rb:1:1: C: Missing top-level class documentation comment.
|
297
|
-
class ApplicationController < ActionController::Base
|
298
|
-
^^^^^
|
299
|
-
spec/internal/app/controllers/application_controller.rb:2:1: C: Use 2 (not 6) spaces for indentation.
|
300
|
-
def index
|
301
|
-
^^^^^^
|
302
|
-
spec/internal/app/controllers/application_controller.rb:5:1: C: Trailing whitespace detected.
|
303
|
-
spec/internal/app/controllers/application_controller.rb:8:3: C: Inconsistent indentation detected.
|
304
|
-
protect_from_forgery with: :exception
|
305
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
306
|
-
spec/internal/app/helpers/application_helper.rb:1:1: C: Missing top-level module documentation comment.
|
307
|
-
module ApplicationHelper
|
308
|
-
^^^^^^
|
309
|
-
spec/internal/app/models/user.rb:1:1: C: Missing top-level class documentation comment.
|
310
|
-
class User < ActiveRecord::Base
|
311
|
-
^^^^^
|
312
|
-
spec/internal/app/models/user.rb:5:80: C: Use the new Ruby 1.9 hash syntax.
|
313
|
-
:recoverable, :rememberable, :trackable, :validatable, :omniauthable, :omniauth_providers => [:orcid]
|
314
|
-
^^^^^^^^^^^^^^^^^^^^^^
|
315
|
-
spec/internal/config/boot.rb:4:33: W: File.exists? is deprecated in favor of File.exist?.
|
316
|
-
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
|
317
|
-
^^^^^^^
|
318
|
-
spec/internal/config/environments/test.rb:17:33: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
319
|
-
config.static_cache_control = "public, max-age=3600"
|
320
|
-
^^^^^^^^^^^^^^^^^^^^^^
|
321
|
-
spec/internal/config/initializers/devise.rb:4:1: C: Use 2 (not 8) spaces for indentation.
|
322
|
-
config.omniauth(:orcid, Orcid.provider.id, Orcid.provider.secret,
|
323
|
-
^^^^^^^^
|
324
|
-
spec/internal/config/initializers/devise.rb:12:1: C: Trailing whitespace detected.
|
325
|
-
spec/internal/config/initializers/devise.rb:16:141: C: Line is too long. [154/140]
|
326
|
-
# config.secret_key = '07af7d8750d7a05a59152b6d5b201a354a4dbfe4f45a261a7ed4e2cf5fdb414dc8358389db71e46075f5d021f46a267018d4940763b53953acb3587673431e52'
|
327
|
-
^^^^^^^^^^^^^^
|
328
|
-
spec/internal/config/initializers/devise.rb:22:3: C: Inconsistent indentation detected.
|
329
|
-
config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
|
330
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
331
|
-
spec/internal/config/initializers/devise.rb:31:3: C: Inconsistent indentation detected.
|
332
|
-
require 'devise/orm/active_record'
|
333
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
334
|
-
spec/internal/config/initializers/devise.rb:53:3: C: Inconsistent indentation detected.
|
335
|
-
config.case_insensitive_keys = [ :email ]
|
336
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
337
|
-
spec/internal/config/initializers/devise.rb:53:35: C: Space inside square brackets detected.
|
338
|
-
config.case_insensitive_keys = [ :email ]
|
339
|
-
^
|
340
|
-
spec/internal/config/initializers/devise.rb:53:42: C: Space inside square brackets detected.
|
341
|
-
config.case_insensitive_keys = [ :email ]
|
342
|
-
^
|
343
|
-
spec/internal/config/initializers/devise.rb:58:3: C: Inconsistent indentation detected.
|
344
|
-
config.strip_whitespace_keys = [ :email ]
|
345
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
346
|
-
spec/internal/config/initializers/devise.rb:58:35: C: Space inside square brackets detected.
|
347
|
-
config.strip_whitespace_keys = [ :email ]
|
348
|
-
^
|
349
|
-
spec/internal/config/initializers/devise.rb:58:42: C: Space inside square brackets detected.
|
350
|
-
config.strip_whitespace_keys = [ :email ]
|
351
|
-
^
|
352
|
-
spec/internal/config/initializers/devise.rb:89:3: C: Inconsistent indentation detected.
|
353
|
-
config.skip_session_storage = [:http_auth]
|
354
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
355
|
-
spec/internal/config/initializers/devise.rb:106:3: C: Inconsistent indentation detected.
|
356
|
-
config.stretches = Rails.env.test? ? 1 : 10
|
357
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
358
|
-
spec/internal/config/initializers/devise.rb:109:141: C: Line is too long. [150/140]
|
359
|
-
# config.pepper = 'e56b0df2ccfc96613a3aa4857d0c63b28e04df50e2b5a6e14197301f86f84b01801341f654687ba1ffd855ac1b1f79d0e680a0cafbf985b8a86817a599fa6e77'
|
360
|
-
^^^^^^^^^^
|
361
|
-
spec/internal/config/initializers/devise.rb:131:3: C: Inconsistent indentation detected.
|
362
|
-
config.reconfirmable = true
|
363
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
364
|
-
spec/internal/config/initializers/devise.rb:149:3: C: Inconsistent indentation detected.
|
365
|
-
config.password_length = 8..128
|
366
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
367
|
-
spec/internal/config/initializers/devise.rb:198:3: C: Inconsistent indentation detected.
|
368
|
-
config.reset_password_within = 6.hours
|
369
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
370
|
-
spec/internal/config/initializers/devise.rb:236:3: C: Inconsistent indentation detected.
|
371
|
-
config.sign_out_via = :delete
|
372
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
373
|
-
spec/internal/config/initializers/orcid_initializer.rb:1:21: W: Unused block argument - config. You can omit the argument if you don't care about it.
|
374
|
-
Orcid.configure do |config|
|
375
|
-
^^^^^^
|
376
|
-
spec/internal/config/initializers/orcid_initializer.rb:8:1: C: Extra blank line detected.
|
377
|
-
spec/internal/config/initializers/secret_token.rb:12:141: C: Line is too long. [177/140]
|
378
|
-
Internal::Application.config.secret_key_base = 'b36c55ad14ec419975fe7e83398b431303efacdae50928fed47e4395d80876ef2f5498fd148f03ffe31b3e6e031050eeb7a290d020d0404e364cd0f811cc5e68'
|
379
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
380
|
-
spec/internal/config/routes.rb:2:8: C: Use the new Ruby 1.9 hash syntax.
|
381
|
-
root :to => "application#index"
|
382
|
-
^^^^^^
|
383
|
-
spec/internal/config/routes.rb:2:15: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
384
|
-
root :to => "application#index"
|
385
|
-
^^^^^^^^^^^^^^^^^^^
|
386
|
-
spec/internal/config/routes.rb:3:26: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
387
|
-
mount Orcid::Engine => "/orcid"
|
388
|
-
^^^^^^^^
|
389
|
-
spec/internal/db/migrate/20140430033740_devise_create_users.rb:1:1: C: Missing top-level class documentation comment.
|
390
|
-
class DeviseCreateUsers < ActiveRecord::Migration
|
391
|
-
^^^^^
|
392
|
-
spec/internal/db/migrate/20140430033740_devise_create_users.rb:2:3: C: Method has too many lines. [15/10]
|
393
|
-
def change
|
394
|
-
^^^
|
395
|
-
spec/internal/db/migrate/20140430033740_devise_create_users.rb:5:59: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
396
|
-
t.string :email, null: false, default: ""
|
397
|
-
^^
|
398
|
-
spec/internal/db/migrate/20140430033740_devise_create_users.rb:6:59: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
399
|
-
t.string :encrypted_password, null: false, default: ""
|
400
|
-
^^
|
401
|
-
spec/internal/db/migrate/20140430033740_devise_create_users.rb:9:15: C: Put one space between the method name and the first argument.
|
402
|
-
t.string :reset_password_token
|
403
|
-
^^^
|
404
|
-
spec/internal/db/migrate/20140430033740_devise_create_users.rb:16:16: C: Put one space between the method name and the first argument.
|
405
|
-
t.integer :sign_in_count, default: 0, null: false
|
406
|
-
^^
|
407
|
-
spec/internal/db/migrate/20140430033740_devise_create_users.rb:19:15: C: Put one space between the method name and the first argument.
|
408
|
-
t.string :current_sign_in_ip
|
409
|
-
^^^
|
410
|
-
spec/internal/db/migrate/20140430033740_devise_create_users.rb:20:15: C: Put one space between the method name and the first argument.
|
411
|
-
t.string :last_sign_in_ip
|
412
|
-
^^^
|
413
|
-
spec/internal/db/migrate/20140430033740_devise_create_users.rb:33:1: C: Extra blank line detected.
|
414
|
-
spec/internal/db/schema.rb:14:38: C: Separate every 3 digits in the integer portion of a number with underscores(_).
|
415
|
-
ActiveRecord::Schema.define(version: 20140430033747) do
|
416
|
-
^^^^^^^^^^^^^^
|
417
|
-
spec/internal/db/schema.rb:16:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
418
|
-
create_table "devise_multi_auth_authentications", force: true do |t|
|
419
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
420
|
-
spec/internal/db/schema.rb:17:14: C: Put one space between the method name and the first argument.
|
421
|
-
t.integer "user_id", null: false
|
422
|
-
^^
|
423
|
-
spec/internal/db/schema.rb:17:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
424
|
-
t.integer "user_id", null: false
|
425
|
-
^^^^^^^^^
|
426
|
-
spec/internal/db/schema.rb:18:13: C: Put one space between the method name and the first argument.
|
427
|
-
t.string "provider", null: false
|
428
|
-
^^^
|
429
|
-
spec/internal/db/schema.rb:18:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
430
|
-
t.string "provider", null: false
|
431
|
-
^^^^^^^^^^
|
432
|
-
spec/internal/db/schema.rb:19:13: C: Put one space between the method name and the first argument.
|
433
|
-
t.string "uid", null: false
|
434
|
-
^^^
|
435
|
-
spec/internal/db/schema.rb:19:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
436
|
-
t.string "uid", null: false
|
437
|
-
^^^^^
|
438
|
-
spec/internal/db/schema.rb:20:13: C: Put one space between the method name and the first argument.
|
439
|
-
t.string "access_token"
|
440
|
-
^^^
|
441
|
-
spec/internal/db/schema.rb:20:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
442
|
-
t.string "access_token"
|
443
|
-
^^^^^^^^^^^^^^
|
444
|
-
spec/internal/db/schema.rb:21:13: C: Put one space between the method name and the first argument.
|
445
|
-
t.string "refresh_token"
|
446
|
-
^^^
|
447
|
-
spec/internal/db/schema.rb:21:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
448
|
-
t.string "refresh_token"
|
449
|
-
^^^^^^^^^^^^^^^
|
450
|
-
spec/internal/db/schema.rb:22:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
451
|
-
t.datetime "expires_at"
|
452
|
-
^^^^^^^^^^^^
|
453
|
-
spec/internal/db/schema.rb:23:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
454
|
-
t.datetime "created_at"
|
455
|
-
^^^^^^^^^^^^
|
456
|
-
spec/internal/db/schema.rb:24:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
457
|
-
t.datetime "updated_at"
|
458
|
-
^^^^^^^^^^^^
|
459
|
-
spec/internal/db/schema.rb:27:13: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
460
|
-
add_index "devise_multi_auth_authentications", ["provider", "uid"], name: "index_devise_multi_auth_authentications_on_provider_and_uid", unique: true
|
461
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
462
|
-
spec/internal/db/schema.rb:27:50: C: Use %w or %W for array of words.
|
463
|
-
add_index "devise_multi_auth_authentications", ["provider", "uid"], name: "index_devise_multi_auth_authentications_on_provider_and_uid", unique: true
|
464
|
-
^^^^^^^^^^^^^^^^^^^
|
465
|
-
spec/internal/db/schema.rb:27:51: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
466
|
-
add_index "devise_multi_auth_authentications", ["provider", "uid"], name: "index_devise_multi_auth_authentications_on_provider_and_uid", unique: true
|
467
|
-
^^^^^^^^^^
|
468
|
-
spec/internal/db/schema.rb:27:63: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
469
|
-
add_index "devise_multi_auth_authentications", ["provider", "uid"], name: "index_devise_multi_auth_authentications_on_provider_and_uid", unique: true
|
470
|
-
^^^^^
|
471
|
-
spec/internal/db/schema.rb:27:77: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
472
|
-
add_index "devise_multi_auth_authentications", ["provider", "uid"], name: "index_devise_multi_auth_authentications_on_provider_and_uid", unique: true
|
473
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
474
|
-
spec/internal/db/schema.rb:27:141: C: Line is too long. [151/140]
|
475
|
-
add_index "devise_multi_auth_authentications", ["provider", "uid"], name: "index_devise_multi_auth_authentications_on_provider_and_uid", unique: true
|
476
|
-
^^^^^^^^^^^
|
477
|
-
spec/internal/db/schema.rb:29:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
478
|
-
create_table "orcid_profile_requests", force: true do |t|
|
479
|
-
^^^^^^^^^^^^^^^^^^^^^^^^
|
480
|
-
spec/internal/db/schema.rb:30:14: C: Put one space between the method name and the first argument.
|
481
|
-
t.integer "user_id", null: false
|
482
|
-
^^
|
483
|
-
spec/internal/db/schema.rb:30:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
484
|
-
t.integer "user_id", null: false
|
485
|
-
^^^^^^^^^
|
486
|
-
spec/internal/db/schema.rb:31:13: C: Put one space between the method name and the first argument.
|
487
|
-
t.string "given_names", null: false
|
488
|
-
^^^
|
489
|
-
spec/internal/db/schema.rb:31:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
490
|
-
t.string "given_names", null: false
|
491
|
-
^^^^^^^^^^^^^
|
492
|
-
spec/internal/db/schema.rb:32:13: C: Put one space between the method name and the first argument.
|
493
|
-
t.string "family_name", null: false
|
494
|
-
^^^
|
495
|
-
spec/internal/db/schema.rb:32:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
496
|
-
t.string "family_name", null: false
|
497
|
-
^^^^^^^^^^^^^
|
498
|
-
spec/internal/db/schema.rb:33:13: C: Put one space between the method name and the first argument.
|
499
|
-
t.string "primary_email", null: false
|
500
|
-
^^^
|
501
|
-
spec/internal/db/schema.rb:33:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
502
|
-
t.string "primary_email", null: false
|
503
|
-
^^^^^^^^^^^^^^^
|
504
|
-
spec/internal/db/schema.rb:34:13: C: Put one space between the method name and the first argument.
|
505
|
-
t.string "orcid_profile_id"
|
506
|
-
^^^
|
507
|
-
spec/internal/db/schema.rb:34:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
508
|
-
t.string "orcid_profile_id"
|
509
|
-
^^^^^^^^^^^^^^^^^^
|
510
|
-
spec/internal/db/schema.rb:35:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
511
|
-
t.datetime "created_at"
|
512
|
-
^^^^^^^^^^^^
|
513
|
-
spec/internal/db/schema.rb:36:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
514
|
-
t.datetime "updated_at"
|
515
|
-
^^^^^^^^^^^^
|
516
|
-
spec/internal/db/schema.rb:39:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
517
|
-
create_table "users", force: true do |t|
|
518
|
-
^^^^^^^
|
519
|
-
spec/internal/db/schema.rb:40:13: C: Put one space between the method name and the first argument.
|
520
|
-
t.string "email", default: "", null: false
|
521
|
-
^^^
|
522
|
-
spec/internal/db/schema.rb:40:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
523
|
-
t.string "email", default: "", null: false
|
524
|
-
^^^^^^^
|
525
|
-
spec/internal/db/schema.rb:40:51: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
526
|
-
t.string "email", default: "", null: false
|
527
|
-
^^
|
528
|
-
spec/internal/db/schema.rb:41:13: C: Put one space between the method name and the first argument.
|
529
|
-
t.string "encrypted_password", default: "", null: false
|
530
|
-
^^^
|
531
|
-
spec/internal/db/schema.rb:41:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
532
|
-
t.string "encrypted_password", default: "", null: false
|
533
|
-
^^^^^^^^^^^^^^^^^^^^
|
534
|
-
spec/internal/db/schema.rb:41:51: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
535
|
-
t.string "encrypted_password", default: "", null: false
|
536
|
-
^^
|
537
|
-
spec/internal/db/schema.rb:42:13: C: Put one space between the method name and the first argument.
|
538
|
-
t.string "reset_password_token"
|
539
|
-
^^^
|
540
|
-
spec/internal/db/schema.rb:42:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
541
|
-
t.string "reset_password_token"
|
542
|
-
^^^^^^^^^^^^^^^^^^^^^^
|
543
|
-
spec/internal/db/schema.rb:43:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
544
|
-
t.datetime "reset_password_sent_at"
|
545
|
-
^^^^^^^^^^^^^^^^^^^^^^^^
|
546
|
-
spec/internal/db/schema.rb:44:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
547
|
-
t.datetime "remember_created_at"
|
548
|
-
^^^^^^^^^^^^^^^^^^^^^
|
549
|
-
spec/internal/db/schema.rb:45:14: C: Put one space between the method name and the first argument.
|
550
|
-
t.integer "sign_in_count", default: 0, null: false
|
551
|
-
^^
|
552
|
-
spec/internal/db/schema.rb:45:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
553
|
-
t.integer "sign_in_count", default: 0, null: false
|
554
|
-
^^^^^^^^^^^^^^^
|
555
|
-
spec/internal/db/schema.rb:46:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
556
|
-
t.datetime "current_sign_in_at"
|
557
|
-
^^^^^^^^^^^^^^^^^^^^
|
558
|
-
spec/internal/db/schema.rb:47:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
559
|
-
t.datetime "last_sign_in_at"
|
560
|
-
^^^^^^^^^^^^^^^^^
|
561
|
-
spec/internal/db/schema.rb:48:13: C: Put one space between the method name and the first argument.
|
562
|
-
t.string "current_sign_in_ip"
|
563
|
-
^^^
|
564
|
-
spec/internal/db/schema.rb:48:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
565
|
-
t.string "current_sign_in_ip"
|
566
|
-
^^^^^^^^^^^^^^^^^^^^
|
567
|
-
spec/internal/db/schema.rb:49:13: C: Put one space between the method name and the first argument.
|
568
|
-
t.string "last_sign_in_ip"
|
569
|
-
^^^
|
570
|
-
spec/internal/db/schema.rb:49:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
571
|
-
t.string "last_sign_in_ip"
|
572
|
-
^^^^^^^^^^^^^^^^^
|
573
|
-
spec/internal/db/schema.rb:50:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
574
|
-
t.datetime "created_at"
|
575
|
-
^^^^^^^^^^^^
|
576
|
-
spec/internal/db/schema.rb:51:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
577
|
-
t.datetime "updated_at"
|
578
|
-
^^^^^^^^^^^^
|
579
|
-
spec/internal/db/schema.rb:54:13: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
580
|
-
add_index "users", ["email"], name: "index_users_on_email", unique: true
|
581
|
-
^^^^^^^
|
582
|
-
spec/internal/db/schema.rb:54:23: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
583
|
-
add_index "users", ["email"], name: "index_users_on_email", unique: true
|
584
|
-
^^^^^^^
|
585
|
-
spec/internal/db/schema.rb:54:39: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
586
|
-
add_index "users", ["email"], name: "index_users_on_email", unique: true
|
587
|
-
^^^^^^^^^^^^^^^^^^^^^^
|
588
|
-
spec/internal/db/schema.rb:55:13: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
589
|
-
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
590
|
-
^^^^^^^
|
591
|
-
spec/internal/db/schema.rb:55:23: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
592
|
-
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
593
|
-
^^^^^^^^^^^^^^^^^^^^^^
|
594
|
-
spec/internal/db/schema.rb:55:54: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
595
|
-
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
596
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
597
|
-
spec/internal/lib/generators/test_app_generator.rb:3:1: C: Missing top-level class documentation comment.
|
598
|
-
class TestAppGenerator < Rails::Generators::Base
|
599
|
-
^^^^^
|
600
|
-
spec/internal/lib/generators/test_app_generator.rb:4:15: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
601
|
-
source_root "spec/test_app_templates"
|
602
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^
|
603
|
-
spec/internal/lib/generators/test_app_generator.rb:7:45: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
604
|
-
application_yml_file = File.expand_path("../../../../../config/application.yml", __FILE__)
|
605
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
606
|
-
spec/internal/lib/generators/test_app_generator.rb:8:53: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
607
|
-
application_yml_example_file = File.expand_path("../../../../../config/application.yml.example", __FILE__)
|
608
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
609
|
-
spec/internal/lib/generators/test_app_generator.rb:10:75: C: Space missing after colon.
|
610
|
-
create_link 'config/application.yml', application_yml_file, symbolic:true
|
611
|
-
^
|
612
|
-
spec/internal/lib/generators/test_app_generator.rb:12:83: C: Space missing after colon.
|
613
|
-
create_link 'config/application.yml', application_yml_example_file, symbolic:true
|
614
|
-
^
|
615
|
-
spec/internal/lib/generators/test_app_generator.rb:24:1: C: Extra empty line detected at body end.
|
616
|
-
spec/internal/test/test_helper.rb:1:5: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
617
|
-
ENV["RAILS_ENV"] ||= "test"
|
618
|
-
^^^^^^^^^^^
|
619
|
-
spec/internal/test/test_helper.rb:1:22: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
620
|
-
ENV["RAILS_ENV"] ||= "test"
|
621
|
-
^^^^^^
|
622
|
-
spec/internal/test/test_helper.rb:5:1: C: Missing top-level class documentation comment.
|
623
|
-
class ActiveSupport::TestCase
|
624
|
-
^^^^^
|
625
|
-
spec/internal/test/test_helper.rb:5:7: C: Use nested module/class definitions instead of compact style.
|
626
|
-
class ActiveSupport::TestCase
|
627
|
-
^^^^^^^^^^^^^^^^^^^^^^^
|
628
|
-
spec/lib/orcid/configuration/provider_spec.rb:4:1: C: Missing top-level module documentation comment.
|
629
|
-
module Orcid
|
630
|
-
^^^^^^
|
631
|
-
spec/lib/orcid/configuration/provider_spec.rb:7:19: C: Avoid using {...} for multi-line blocks.
|
632
|
-
let(:storage) {
|
633
|
-
^
|
634
|
-
spec/lib/orcid/configuration/provider_spec.rb:15:44: C: Avoid comma after the last item of a hash.
|
635
|
-
'ORCID_APP_SECRET' => '_APP_SECRET',
|
636
|
-
^
|
637
|
-
spec/lib/orcid/configuration_spec.rb:3:1: C: Missing top-level module documentation comment.
|
638
|
-
module Orcid
|
639
|
-
^^^^^^
|
640
|
-
spec/lib/orcid/configuration_spec.rb:16:20: C: Avoid using {...} for multi-line blocks.
|
641
|
-
let(:legend) {
|
642
|
-
^
|
643
|
-
spec/lib/orcid/configuration_spec.rb:19:12: C: Use the new lambda literal syntax ->(params) {...}.
|
644
|
-
[lambda{|*| 'spaghetti'}, :work_type]
|
645
|
-
^^^^^^
|
646
|
-
spec/lib/orcid/configuration_spec.rb:19:18: C: Space missing to the left of {.
|
647
|
-
[lambda{|*| 'spaghetti'}, :work_type]
|
648
|
-
^
|
649
|
-
spec/lib/orcid/configuration_spec.rb:19:18: C: Space between { and | missing.
|
650
|
-
[lambda{|*| 'spaghetti'}, :work_type]
|
651
|
-
^^
|
652
|
-
spec/lib/orcid/configuration_spec.rb:19:34: C: Space missing inside }.
|
653
|
-
[lambda{|*| 'spaghetti'}, :work_type]
|
654
|
-
^
|
655
|
-
spec/lib/orcid/configuration_spec.rb:23:58: C: Space missing inside }.
|
656
|
-
let(:article) { NonOrcid::Article.new(title: title)}
|
657
|
-
^
|
658
|
-
spec/lib/orcid/named_callbacks_spec.rb:4:1: C: Missing top-level module documentation comment.
|
659
|
-
module Orcid
|
660
|
-
^^^^^^
|
661
|
-
spec/lib/orcid/named_callbacks_spec.rb:7:24: C: Space inside square brackets detected.
|
662
|
-
Given(:context) { [ ] }
|
663
|
-
^
|
664
|
-
spec/lib/orcid/named_callbacks_spec.rb:10:14: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
665
|
-
describe "with a named callback" do
|
666
|
-
^^^^^^^^^^^^^^^^^^^^^^^
|
667
|
-
spec/lib/orcid/named_callbacks_spec.rb:12:52: C: Space missing after comma.
|
668
|
-
When { named_callback.call(callback_name, 'a',:hello) }
|
669
|
-
^
|
670
|
-
spec/lib/orcid/named_callbacks_spec.rb:16:14: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
671
|
-
describe "with a named callback called by a string" do
|
672
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
673
|
-
spec/lib/orcid/named_callbacks_spec.rb:18:52: C: Space missing after comma.
|
674
|
-
When { named_callback.call(callback_name, 'a',:hello) }
|
675
|
-
^
|
676
|
-
spec/lib/orcid/named_callbacks_spec.rb:22:14: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
677
|
-
describe "with a undeclared callback" do
|
678
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
679
|
-
spec/lib/orcid_spec.rb:27:13: C: Space missing to the left of {.
|
680
|
-
expect{|b| Orcid.configure(&b) }.to yield_with_args(Orcid::Configuration)
|
681
|
-
^
|
682
|
-
spec/lib/orcid_spec.rb:27:13: C: Space between { and | missing.
|
683
|
-
expect{|b| Orcid.configure(&b) }.to yield_with_args(Orcid::Configuration)
|
684
|
-
^^
|
685
|
-
spec/lib/orcid_spec.rb:37:48: C: Space missing after comma.
|
686
|
-
Orcid.connect_user_and_orcid_profile(user,orcid_profile_id)
|
687
|
-
^
|
688
|
-
spec/lib/orcid_spec.rb:56:14: C: Avoid using {...} for multi-line blocks.
|
689
|
-
expect {
|
690
|
-
^
|
691
|
-
spec/lib/orcid_spec.rb:63:27: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
692
|
-
let(:client) { double("Client")}
|
693
|
-
^^^^^^^^
|
694
|
-
spec/lib/orcid_spec.rb:63:36: C: Space missing inside }.
|
695
|
-
let(:client) { double("Client")}
|
696
|
-
^
|
697
|
-
spec/lib/orcid_spec.rb:65:30: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
698
|
-
let(:tokenizer) { double("Tokenizer") }
|
699
|
-
^^^^^^^^^^^
|
700
|
-
spec/lib/orcid_spec.rb:88:1: C: Do not use block comments.
|
701
|
-
=begin
|
702
|
-
^^^^^^
|
703
|
-
spec/models/orcid/profile_connection_spec.rb:3:1: C: Missing top-level module documentation comment.
|
704
|
-
module Orcid
|
705
|
-
^^^^^^
|
706
|
-
spec/models/orcid/profile_connection_spec.rb:5:35: C: Space missing inside }.
|
707
|
-
let(:email) { 'test@hello.com'}
|
708
|
-
^
|
709
|
-
spec/models/orcid/profile_connection_spec.rb:7:42: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
710
|
-
let(:profile_query_service) { double("Profile Lookup Service") }
|
711
|
-
^^^^^^^^^^^^^^^^^^^^^^^^
|
712
|
-
spec/models/orcid/profile_connection_spec.rb:9:13: C: Avoid using {...} for multi-line blocks.
|
713
|
-
subject {
|
714
|
-
^
|
715
|
-
spec/models/orcid/profile_connection_spec.rb:10:66: C: Avoid using {...} for multi-line blocks.
|
716
|
-
Orcid::ProfileConnection.new(email: email, user: user).tap { |pc|
|
717
|
-
^
|
718
|
-
spec/models/orcid/profile_connection_spec.rb:27:71: C: Space missing inside }.
|
719
|
-
subject { Orcid::ProfileConnection.new(email: email, user: user)}
|
720
|
-
^
|
721
|
-
spec/models/orcid/profile_connection_spec.rb:37:73: C: Space missing inside }.
|
722
|
-
subject { Orcid::ProfileConnection.new(email: email, user: user)}
|
723
|
-
^
|
724
|
-
spec/models/orcid/profile_connection_spec.rb:44:32: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
725
|
-
let(:persister) { double("Persister") }
|
726
|
-
^^^^^^^^^^^
|
727
|
-
spec/models/orcid/profile_connection_spec.rb:55:16: C: Avoid using {...} for multi-line blocks.
|
728
|
-
expect {
|
729
|
-
^
|
730
|
-
spec/models/orcid/profile_connection_spec.rb:67:18: C: Space between { and | missing.
|
731
|
-
expect {|b| subject.with_orcid_profile_candidates(&b) }.to yield_with_args(:query_response)
|
732
|
-
^^
|
733
|
-
spec/models/orcid/profile_connection_spec.rb:75:18: C: Space between { and | missing.
|
734
|
-
expect {|b| subject.with_orcid_profile_candidates(&b) }.to_not yield_control
|
735
|
-
^^
|
736
|
-
spec/models/orcid/profile_request_spec.rb:3:1: C: Missing top-level module documentation comment.
|
737
|
-
module Orcid
|
738
|
-
^^^^^^
|
739
|
-
spec/models/orcid/profile_request_spec.rb:5:51: C: Space missing inside }.
|
740
|
-
let(:orcid_profile_id) { '0000-0001-8025-637X'}
|
741
|
-
^
|
742
|
-
spec/models/orcid/profile_request_spec.rb:7:22: C: Avoid using {...} for multi-line blocks.
|
743
|
-
let(:attributes) {
|
744
|
-
^
|
745
|
-
spec/models/orcid/profile_request_spec.rb:42:16: C: Avoid using {...} for multi-line blocks.
|
746
|
-
expect {
|
747
|
-
^
|
748
|
-
spec/models/orcid/profile_request_spec.rb:66:18: C: Avoid using {...} for multi-line blocks.
|
749
|
-
expect {
|
750
|
-
^
|
751
|
-
spec/models/orcid/profile_request_spec.rb:81:18: C: Avoid using {...} for multi-line blocks.
|
752
|
-
expect {
|
753
|
-
^
|
754
|
-
spec/models/orcid/profile_request_spec.rb:97:56: C: Place the . on the next line, together with the method name.
|
755
|
-
validator.should_receive(:call).with(subject).
|
756
|
-
^
|
757
|
-
spec/models/orcid/profile_request_spec.rb:99:77: C: Place the . on the next line, together with the method name.
|
758
|
-
payload_xml_builder.should_receive(:call).with(subject.attributes).
|
759
|
-
^
|
760
|
-
spec/models/orcid/profile_request_spec.rb:101:75: C: Place the . on the next line, together with the method name.
|
761
|
-
profile_creation_service.should_receive(:call).with(xml_payload).
|
762
|
-
^
|
763
|
-
spec/models/orcid/profile_request_spec.rb:116:56: C: Place the . on the next line, together with the method name.
|
764
|
-
validator.should_receive(:call).with(subject).
|
765
|
-
^
|
766
|
-
spec/models/orcid/profile_spec.rb:3:1: C: Missing top-level module documentation comment.
|
767
|
-
module Orcid
|
768
|
-
^^^^^^
|
769
|
-
spec/models/orcid/profile_spec.rb:7:27: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
770
|
-
let(:mapper) { double("Mapper") }
|
771
|
-
^^^^^^^^
|
772
|
-
spec/models/orcid/profile_spec.rb:8:35: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
773
|
-
let(:non_orcid_work) { double("A non-ORCID Work") }
|
774
|
-
^^^^^^^^^^^^^^^^^^
|
775
|
-
spec/models/orcid/profile_spec.rb:9:31: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
776
|
-
let(:orcid_work) { double("Orcid::Work") }
|
777
|
-
^^^^^^^^^^^^^
|
778
|
-
spec/models/orcid/profile_spec.rb:10:33: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
779
|
-
let(:xml_renderer) { double("Renderer") }
|
780
|
-
^^^^^^^^^^
|
781
|
-
spec/models/orcid/profile_spec.rb:11:31: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
782
|
-
let(:xml_parser) { double("Parser") }
|
783
|
-
^^^^^^^^
|
784
|
-
spec/models/orcid/profile_spec.rb:12:24: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
785
|
-
let(:xml) { double("XML Payload")}
|
786
|
-
^^^^^^^^^^^^^
|
787
|
-
spec/models/orcid/profile_spec.rb:12:38: C: Space missing inside }.
|
788
|
-
let(:xml) { double("XML Payload")}
|
789
|
-
^
|
790
|
-
spec/models/orcid/profile_spec.rb:14:13: C: Avoid using {...} for multi-line blocks.
|
791
|
-
subject {
|
792
|
-
^
|
793
|
-
spec/models/orcid/profile_spec.rb:29:36: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
794
|
-
let(:parsed_object) { double("Parsed Object")}
|
795
|
-
^^^^^^^^^^^^^^^
|
796
|
-
spec/models/orcid/profile_spec.rb:29:52: C: Space missing inside }.
|
797
|
-
let(:parsed_object) { double("Parsed Object")}
|
798
|
-
^
|
799
|
-
spec/models/orcid/profile_spec.rb:30:36: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
800
|
-
let(:response_body) { double("XML Response") }
|
801
|
-
^^^^^^^^^^^^^^
|
802
|
-
spec/models/orcid/profile_spec.rb:39:1: C: Extra blank line detected.
|
803
|
-
spec/models/orcid/profile_spec.rb:70:60: C: Do not use parentheses for method calls with no arguments.
|
804
|
-
Orcid.stub(:access_token_for).and_return(Object.new())
|
805
|
-
^
|
806
|
-
spec/models/orcid/work/xml_parser_spec.rb:3:1: C: Missing top-level module documentation comment.
|
807
|
-
module Orcid
|
808
|
-
^^^^^^
|
809
|
-
spec/models/orcid/work/xml_parser_spec.rb:16:33: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
810
|
-
its(:title) { should eq "Another Test Drive" }
|
811
|
-
^^^^^^^^^^^^^^^^^^^^
|
812
|
-
spec/models/orcid/work/xml_parser_spec.rb:17:36: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
813
|
-
its(:put_code) { should eq "303475" }
|
814
|
-
^^^^^^^^
|
815
|
-
spec/models/orcid/work/xml_parser_spec.rb:18:37: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
816
|
-
its(:work_type) { should eq "test" }
|
817
|
-
^^^^^^
|
818
|
-
spec/models/orcid/work/xml_parser_spec.rb:33:33: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
819
|
-
its(:title) { should eq "Test Driven Orcid Integration" }
|
820
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
821
|
-
spec/models/orcid/work/xml_parser_spec.rb:34:36: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
822
|
-
its(:put_code) { should eq "303474" }
|
823
|
-
^^^^^^^^
|
824
|
-
spec/models/orcid/work/xml_parser_spec.rb:35:37: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
825
|
-
its(:work_type) { should eq "test" }
|
826
|
-
^^^^^^
|
827
|
-
spec/models/orcid/work/xml_parser_spec.rb:39:1: C: Extra empty line detected at body end.
|
828
|
-
spec/models/orcid/work/xml_renderer_spec.rb:3:1: C: Missing top-level module documentation comment.
|
829
|
-
module Orcid
|
830
|
-
^^^^^^
|
831
|
-
spec/models/orcid/work_spec.rb:3:1: C: Missing top-level module documentation comment.
|
832
|
-
module Orcid
|
833
|
-
^^^^^^
|
834
|
-
spec/models/orcid/work_spec.rb:5:22: C: Avoid using {...} for multi-line blocks.
|
835
|
-
let(:attributes) {
|
836
|
-
^
|
837
|
-
spec/models/orcid/work_spec.rb:10:32: C: Space inside square brackets detected.
|
838
|
-
external_identifiers: [ {type: 'doi', identifier: 'abc-123' }]
|
839
|
-
^
|
840
|
-
spec/models/orcid/work_spec.rb:10:33: C: Space inside { missing.
|
841
|
-
external_identifiers: [ {type: 'doi', identifier: 'abc-123' }]
|
842
|
-
^
|
843
|
-
spec/models/orcid/work_spec.rb:25:46: C: Space missing inside }.
|
844
|
-
its(:id) { should eq subject.put_code}
|
845
|
-
^
|
846
|
-
spec/models/orcid/work_spec.rb:29:64: C: Space missing inside }.
|
847
|
-
its(:id) { should eq [subject.title, subject.work_type]}
|
848
|
-
^
|
849
|
-
spec/models/orcid/work_spec.rb:52:1: C: Extra empty line detected at body end.
|
850
|
-
spec/services/orcid/remote/profile_creation_service_spec.rb:4:1: C: Missing top-level module documentation comment.
|
851
|
-
module Orcid::Remote
|
852
|
-
^^^^^^
|
853
|
-
spec/services/orcid/remote/profile_creation_service_spec.rb:4:8: C: Use nested module/class definitions instead of compact style.
|
854
|
-
module Orcid::Remote
|
855
|
-
^^^^^^^^^^^^^
|
856
|
-
spec/services/orcid/remote/profile_creation_service_spec.rb:7:22: C: Space inside { missing.
|
857
|
-
Given(:config) { {token: token, headers: request_headers, path: 'path/to/somewhere' } }
|
858
|
-
^
|
859
|
-
spec/services/orcid/remote/profile_creation_service_spec.rb:8:28: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
860
|
-
Given(:token) { double("Token", post: response) }
|
861
|
-
^^^^^^^
|
862
|
-
spec/services/orcid/remote/profile_creation_service_spec.rb:10:29: C: Avoid using {...} for multi-line blocks.
|
863
|
-
Given(:request_headers) {
|
864
|
-
^
|
865
|
-
spec/services/orcid/remote/profile_creation_service_spec.rb:16:22: C: Avoid using {...} for multi-line blocks.
|
866
|
-
Given(:response) {
|
867
|
-
^
|
868
|
-
spec/services/orcid/remote/profile_creation_service_spec.rb:17:14: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
869
|
-
double("Response", headers: { location: File.join("/", minted_orcid, "orcid-profile") })
|
870
|
-
^^^^^^^^^^
|
871
|
-
spec/services/orcid/remote/profile_creation_service_spec.rb:17:57: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
872
|
-
double("Response", headers: { location: File.join("/", minted_orcid, "orcid-profile") })
|
873
|
-
^^^
|
874
|
-
spec/services/orcid/remote/profile_creation_service_spec.rb:17:76: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
875
|
-
double("Response", headers: { location: File.join("/", minted_orcid, "orcid-profile") })
|
876
|
-
^^^^^^^^^^^^^^^
|
877
|
-
spec/services/orcid/remote/profile_creation_service_spec.rb:23:24: C: Avoid using {...} for multi-line blocks.
|
878
|
-
Given(:response) {
|
879
|
-
^
|
880
|
-
spec/services/orcid/remote/profile_creation_service_spec.rb:24:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
881
|
-
double("Response", headers: { location: File.join("/", minted_orcid, "orcid-profile") })
|
882
|
-
^^^^^^^^^^
|
883
|
-
spec/services/orcid/remote/profile_creation_service_spec.rb:24:59: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
884
|
-
double("Response", headers: { location: File.join("/", minted_orcid, "orcid-profile") })
|
885
|
-
^^^
|
886
|
-
spec/services/orcid/remote/profile_creation_service_spec.rb:24:78: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
887
|
-
double("Response", headers: { location: File.join("/", minted_orcid, "orcid-profile") })
|
888
|
-
^^^^^^^^^^^^^^^
|
889
|
-
spec/services/orcid/remote/profile_creation_service_spec.rb:26:52: C: Space missing inside }.
|
890
|
-
Then { returned_value.should eq(minted_orcid)}
|
891
|
-
^
|
892
|
-
spec/services/orcid/remote/profile_creation_service_spec.rb:28:113: C: Space missing inside }.
|
893
|
-
And { token.should have_received(:post).with(config.fetch(:path), body: payload, headers: request_headers)}
|
894
|
-
^
|
895
|
-
spec/services/orcid/remote/profile_creation_service_spec.rb:32:24: C: Avoid using {...} for multi-line blocks.
|
896
|
-
Given(:response) {
|
897
|
-
^
|
898
|
-
spec/services/orcid/remote/profile_creation_service_spec.rb:33:16: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
899
|
-
double("Response", headers: { location: "" })
|
900
|
-
^^^^^^^^^^
|
901
|
-
spec/services/orcid/remote/profile_creation_service_spec.rb:33:49: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
902
|
-
double("Response", headers: { location: "" })
|
903
|
-
^^
|
904
|
-
spec/services/orcid/remote/profile_creation_service_spec.rb:35:45: C: Space missing inside }.
|
905
|
-
Then { returned_value.should eq(false)}
|
906
|
-
^
|
907
|
-
spec/services/orcid/remote/profile_creation_service_spec.rb:37:113: C: Space missing inside }.
|
908
|
-
And { token.should have_received(:post).with(config.fetch(:path), body: payload, headers: request_headers)}
|
909
|
-
^
|
910
|
-
spec/services/orcid/remote/profile_query_service/query_parameter_builder_spec.rb:4:1: C: Missing top-level module documentation comment.
|
911
|
-
module Orcid::Remote
|
912
|
-
^^^^^^
|
913
|
-
spec/services/orcid/remote/profile_query_service/query_parameter_builder_spec.rb:4:8: C: Use nested module/class definitions instead of compact style.
|
914
|
-
module Orcid::Remote
|
915
|
-
^^^^^^^^^^^^^
|
916
|
-
spec/services/orcid/remote/profile_query_service/query_parameter_builder_spec.rb:5:1: C: Extra empty line detected at body beginning.
|
917
|
-
spec/services/orcid/remote/profile_query_service/query_parameter_builder_spec.rb:9:21: C: Avoid using {...} for multi-line blocks.
|
918
|
-
Given(:input) {
|
919
|
-
^
|
920
|
-
spec/services/orcid/remote/profile_query_service/query_parameter_builder_spec.rb:10:17: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
921
|
-
{ text: "Hello", email: 'jeremy.n.friesen@gmail.com' }
|
922
|
-
^^^^^^^
|
923
|
-
spec/services/orcid/remote/profile_query_service/query_parameter_builder_spec.rb:16:21: C: Avoid using {...} for multi-line blocks.
|
924
|
-
Given(:input) {
|
925
|
-
^
|
926
|
-
spec/services/orcid/remote/profile_query_service/query_parameter_builder_spec.rb:17:17: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
927
|
-
{ text: "" , email: nil}
|
928
|
-
^^
|
929
|
-
spec/services/orcid/remote/profile_query_service/query_parameter_builder_spec.rb:17:32: C: Space inside } missing.
|
930
|
-
{ text: "" , email: nil}
|
931
|
-
^
|
932
|
-
spec/services/orcid/remote/profile_query_service/query_parameter_builder_spec.rb:19:40: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
933
|
-
Then { expect(response).to eq(q: "") }
|
934
|
-
^^
|
935
|
-
spec/services/orcid/remote/profile_query_service/query_parameter_builder_spec.rb:23:21: C: Avoid using {...} for multi-line blocks.
|
936
|
-
Given(:input) {
|
937
|
-
^
|
938
|
-
spec/services/orcid/remote/profile_query_service/query_parameter_builder_spec.rb:30:21: C: Avoid using {...} for multi-line blocks.
|
939
|
-
Given(:input) {
|
940
|
-
^
|
941
|
-
spec/services/orcid/remote/profile_query_service/query_parameter_builder_spec.rb:37:21: C: Avoid using {...} for multi-line blocks.
|
942
|
-
Given(:input) {
|
943
|
-
^
|
944
|
-
spec/services/orcid/remote/profile_query_service/search_response_spec.rb:4:1: C: Missing top-level module documentation comment.
|
945
|
-
module Orcid::Remote
|
946
|
-
^^^^^^
|
947
|
-
spec/services/orcid/remote/profile_query_service/search_response_spec.rb:4:8: C: Use nested module/class definitions instead of compact style.
|
948
|
-
module Orcid::Remote
|
949
|
-
^^^^^^^^^^^^^
|
950
|
-
spec/services/orcid/remote/profile_query_service/search_response_spec.rb:6:26: C: Space inside { missing.
|
951
|
-
Given(:attributes) { {id: 'Hello', label: 'World', junk: 'JUNK!', biography: "Extended Biography"} }
|
952
|
-
^
|
953
|
-
spec/services/orcid/remote/profile_query_service/search_response_spec.rb:6:82: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
954
|
-
Given(:attributes) { {id: 'Hello', label: 'World', junk: 'JUNK!', biography: "Extended Biography"} }
|
955
|
-
^^^^^^^^^^^^^^^^^^^^
|
956
|
-
spec/services/orcid/remote/profile_query_service/search_response_spec.rb:6:102: C: Space inside } missing.
|
957
|
-
Given(:attributes) { {id: 'Hello', label: 'World', junk: 'JUNK!', biography: "Extended Biography"} }
|
958
|
-
^
|
959
|
-
spec/services/orcid/remote/profile_query_service/search_response_spec.rb:12:17: C: Space missing to the left of {.
|
960
|
-
And { expect{search_response.junk }.to raise_error }
|
961
|
-
^
|
962
|
-
spec/services/orcid/remote/profile_query_service/search_response_spec.rb:12:18: C: Space missing inside {.
|
963
|
-
And { expect{search_response.junk }.to raise_error }
|
964
|
-
^
|
965
|
-
spec/services/orcid/remote/profile_query_service_spec.rb:5:1: C: Missing top-level module documentation comment.
|
966
|
-
module Orcid::Remote
|
967
|
-
^^^^^^
|
968
|
-
spec/services/orcid/remote/profile_query_service_spec.rb:5:8: C: Use nested module/class definitions instead of compact style.
|
969
|
-
module Orcid::Remote
|
970
|
-
^^^^^^^^^^^^^
|
971
|
-
spec/services/orcid/remote/profile_query_service_spec.rb:10:20: C: Avoid using {...} for multi-line blocks.
|
972
|
-
Given(:config) {
|
973
|
-
^
|
974
|
-
spec/services/orcid/remote/profile_query_service_spec.rb:19:62: C: Space missing inside }.
|
975
|
-
Given(:query_parameter_builder) { double('Query Builder')}
|
976
|
-
^
|
977
|
-
spec/services/orcid/remote/profile_query_service_spec.rb:20:31: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
978
|
-
Given(:response) { double("Response", body: response_body)} # See below
|
979
|
-
^^^^^^^^^^
|
980
|
-
spec/services/orcid/remote/profile_query_service_spec.rb:20:63: C: Space missing inside }.
|
981
|
-
Given(:response) { double("Response", body: response_body)} # See below
|
982
|
-
^
|
983
|
-
spec/services/orcid/remote/profile_query_service_spec.rb:21:28: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
984
|
-
Given(:token) { double("Token") }
|
985
|
-
^^^^^^^
|
986
|
-
spec/services/orcid/remote/profile_query_service_spec.rb:22:27: C: Avoid using {...} for multi-line blocks.
|
987
|
-
Given(:json_response) {
|
988
|
-
^
|
989
|
-
spec/services/orcid/remote/profile_query_service_spec.rb:24:24: C: Redundant curly braces around a hash parameter.
|
990
|
-
OpenStruct.new({ 'id' => orcid_profile_id, 'label' => "Corwin Amber (#{email}) [ORCID: #{orcid_profile_id}]", 'biography' => biography })
|
991
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
992
|
-
spec/services/orcid/remote/profile_query_service_spec.rb:24:141: C: Line is too long. [145/140]
|
993
|
-
OpenStruct.new({ 'id' => orcid_profile_id, 'label' => "Corwin Amber (#{email}) [ORCID: #{orcid_profile_id}]", 'biography' => biography })
|
994
|
-
^^^^^
|
995
|
-
spec/services/orcid/remote/profile_query_service_spec.rb:27:33: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
996
|
-
Given(:parameters) { double("Parameters") }
|
997
|
-
^^^^^^^^^^^^
|
998
|
-
spec/services/orcid/remote/profile_query_service_spec.rb:28:44: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
999
|
-
Given(:normalized_parameters) { double("Normalized Parameters") }
|
1000
|
-
^^^^^^^^^^^^^^^^^^^^^^^
|
1001
|
-
spec/services/orcid/remote/profile_query_service_spec.rb:42:27: C: Avoid using {...} for multi-line blocks.
|
1002
|
-
Given(:response_body) {
|
1003
|
-
^
|
1004
|
-
spec/services/orcid/remote/service_spec.rb:4:1: C: Missing top-level module documentation comment.
|
1005
|
-
module Orcid::Remote
|
1006
|
-
^^^^^^
|
1007
|
-
spec/services/orcid/remote/service_spec.rb:4:8: C: Use nested module/class definitions instead of compact style.
|
1008
|
-
module Orcid::Remote
|
1009
|
-
^^^^^^^^^^^^^
|
1010
|
-
spec/services/orcid/remote/service_spec.rb:7:20: C: Avoid using {...} for multi-line blocks.
|
1011
|
-
Given(:runner) {
|
1012
|
-
^
|
1013
|
-
spec/services/orcid/remote/service_spec.rb:8:27: C: Avoid using {...} for multi-line blocks.
|
1014
|
-
described_class.new { |on|
|
1015
|
-
^
|
1016
|
-
spec/services/orcid/remote/service_spec.rb:9:18: C: Space between { and | missing.
|
1017
|
-
on.found {|a,b| context.invoked("FOUND", a,b) }
|
1018
|
-
^^
|
1019
|
-
spec/services/orcid/remote/service_spec.rb:9:21: C: Space missing after comma.
|
1020
|
-
on.found {|a,b| context.invoked("FOUND", a,b) }
|
1021
|
-
^
|
1022
|
-
spec/services/orcid/remote/service_spec.rb:9:41: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
1023
|
-
on.found {|a,b| context.invoked("FOUND", a,b) }
|
1024
|
-
^^^^^^^
|
1025
|
-
spec/services/orcid/remote/service_spec.rb:9:51: C: Space missing after comma.
|
1026
|
-
on.found {|a,b| context.invoked("FOUND", a,b) }
|
1027
|
-
^
|
1028
|
-
spec/services/orcid/remote/service_spec.rb:13:14: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
1029
|
-
describe "calling defined callback" do
|
1030
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
1031
|
-
spec/services/orcid/remote/service_spec.rb:15:58: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
1032
|
-
Then { context.should have_received(:invoked).with("FOUND", :first, :second) }
|
1033
|
-
^^^^^^^
|
1034
|
-
spec/services/orcid/remote/service_spec.rb:19:14: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
1035
|
-
describe "calling undefined callback" do
|
1036
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
1037
|
-
spec/services/orcid/remote/work_service_spec.rb:5:1: C: Missing top-level module documentation comment.
|
1038
|
-
module Orcid::Remote
|
1039
|
-
^^^^^^
|
1040
|
-
spec/services/orcid/remote/work_service_spec.rb:5:8: C: Use nested module/class definitions instead of compact style.
|
1041
|
-
module Orcid::Remote
|
1042
|
-
^^^^^^^^^^^^^
|
1043
|
-
spec/services/orcid/remote/work_service_spec.rb:8:26: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
1044
|
-
let(:token) { double("Token") }
|
1045
|
-
^^^^^^^
|
1046
|
-
spec/services/orcid/remote/work_service_spec.rb:11:29: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
1047
|
-
let(:response) { double("Response", body: 'Body') }
|
1048
|
-
^^^^^^^^^^
|
1049
|
-
spec/services/orcid/remote/work_service_spec.rb:14:107: C: Space missing inside }.
|
1050
|
-
let(:token) { double('Token', client: client, token: 'access_token', refresh_token: 'refresh_token')}
|
1051
|
-
^
|
1052
|
-
spec/services/orcid/remote/work_service_spec.rb:15:75: C: Space missing inside }.
|
1053
|
-
let(:client) { double('Client', id: '123', site: 'URL', options: {})}
|
1054
|
-
^
|
1055
|
-
spec/services/orcid/remote/work_service_spec.rb:17:27: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
1056
|
-
response = double("Response", status: '100', body: 'body')
|
1057
|
-
^^^^^^^^^^
|
1058
|
-
spec/services/orcid/remote/work_service_spec.rb:22:16: C: Avoid using {...} for multi-line blocks.
|
1059
|
-
expect {
|
1060
|
-
^
|
1061
|
-
spec/services/orcid/remote/work_service_spec.rb:27:39: C: Place the . on the next line, together with the method name.
|
1062
|
-
token.should_receive(:request).
|
1063
|
-
^
|
1064
|
-
spec/services/orcid/remote/work_service_spec.rb:28:104: C: Place the . on the next line, together with the method name.
|
1065
|
-
with(:post, "v1.1/#{orcid_profile_id}/orcid-works/", body: payload, headers: request_headers).
|
1066
|
-
^
|
1067
|
-
spec/spec_helper.rb:5:5: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
1068
|
-
ENV["RAILS_ENV"] ||= 'test'
|
1069
|
-
^^^^^^^^^^^
|
1070
|
-
spec/spec_helper.rb:9:26: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
1071
|
-
SimpleCov.command_name "spec"
|
1072
|
-
^^^^^^
|
1073
|
-
spec/spec_helper.rb:12:1: C: Extra blank line detected.
|
1074
|
-
spec/spec_helper.rb:16:26: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
1075
|
-
require File.expand_path("../internal/config/environment.rb", __FILE__)
|
1076
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
1077
|
-
spec/spec_helper.rb:33:22: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
1078
|
-
Dir[File.expand_path("../support/**/*.rb",__FILE__)].each {|f| require f}
|
1079
|
-
^^^^^^^^^^^^^^^^^^^^
|
1080
|
-
spec/spec_helper.rb:33:42: C: Space missing after comma.
|
1081
|
-
Dir[File.expand_path("../support/**/*.rb",__FILE__)].each {|f| require f}
|
1082
|
-
^
|
1083
|
-
spec/spec_helper.rb:33:59: C: Space between { and | missing.
|
1084
|
-
Dir[File.expand_path("../support/**/*.rb",__FILE__)].each {|f| require f}
|
1085
|
-
^^
|
1086
|
-
spec/spec_helper.rb:33:73: C: Space missing inside }.
|
1087
|
-
Dir[File.expand_path("../support/**/*.rb",__FILE__)].each {|f| require f}
|
1088
|
-
^
|
1089
|
-
spec/spec_helper.rb:34:22: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
1090
|
-
Dir[File.expand_path("../factories/**/*.rb",__FILE__)].each {|f| require f}
|
1091
|
-
^^^^^^^^^^^^^^^^^^^^^^
|
1092
|
-
spec/spec_helper.rb:34:44: C: Space missing after comma.
|
1093
|
-
Dir[File.expand_path("../factories/**/*.rb",__FILE__)].each {|f| require f}
|
1094
|
-
^
|
1095
|
-
spec/spec_helper.rb:34:61: C: Space between { and | missing.
|
1096
|
-
Dir[File.expand_path("../factories/**/*.rb",__FILE__)].each {|f| require f}
|
1097
|
-
^^
|
1098
|
-
spec/spec_helper.rb:34:75: C: Space missing inside }.
|
1099
|
-
Dir[File.expand_path("../factories/**/*.rb",__FILE__)].each {|f| require f}
|
1100
|
-
^
|
1101
|
-
spec/spec_helper.rb:40:49: C: Place the . on the next line, together with the method name.
|
1102
|
-
request.env['warden'].stub(:authenticate!).
|
1103
|
-
^
|
1104
|
-
spec/spec_helper.rb:41:28: C: Redundant curly braces around a hash parameter.
|
1105
|
-
and_throw(:warden, {:scope => :user})
|
1106
|
-
^^^^^^^^^^^^^^^^^
|
1107
|
-
spec/spec_helper.rb:41:28: C: Space inside { missing.
|
1108
|
-
and_throw(:warden, {:scope => :user})
|
1109
|
-
^
|
1110
|
-
spec/spec_helper.rb:41:29: C: Use the new Ruby 1.9 hash syntax.
|
1111
|
-
and_throw(:warden, {:scope => :user})
|
1112
|
-
^^^^^^^^^
|
1113
|
-
spec/spec_helper.rb:41:44: C: Space inside } missing.
|
1114
|
-
and_throw(:warden, {:scope => :user})
|
1115
|
-
^
|
1116
|
-
spec/spec_helper.rb:42:23: C: Use the new Ruby 1.9 hash syntax.
|
1117
|
-
controller.stub :current_user => nil
|
1118
|
-
^^^^^^^^^^^^^^^^
|
1119
|
-
spec/spec_helper.rb:45:23: C: Use the new Ruby 1.9 hash syntax.
|
1120
|
-
controller.stub :current_user => user
|
1121
|
-
^^^^^^^^^^^^^^^^
|
1122
|
-
spec/spec_helper.rb:56:1: C: Extra empty line detected at body end.
|
1123
|
-
spec/spec_helper.rb:59:1: C: Missing top-level module documentation comment.
|
1124
|
-
module FixtureFiles
|
1125
|
-
^^^^^^
|
1126
|
-
spec/spec_helper.rb:61:45: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
1127
|
-
Pathname.new(File.expand_path(File.join("../fixtures", path), __FILE__))
|
1128
|
-
^^^^^^^^^^^^^
|
1129
|
-
spec/spec_helper.rb:87:18: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
1130
|
-
config.order = "random"
|
1131
|
-
^^^^^^^^
|
1132
|
-
spec/support/non_orcid_models.rb:2:3: C: Missing top-level class documentation comment.
|
1133
|
-
class Article
|
1134
|
-
^^^^^
|
1135
|
-
spec/support/non_orcid_models.rb:11:4: C: Final newline missing.
|
1136
|
-
end
|
1137
|
-
|
1138
|
-
spec/support/stub_callback.rb:1:1: C: Missing top-level class documentation comment.
|
1139
|
-
class StubCallback
|
1140
|
-
^^^^^
|
1141
|
-
spec/support/stub_callback.rb:6:16: W: Unused method argument - args. If it's necessary, use _ or _args as an argument name to indicate that it won't be used. You can also write as invoked(*) if you want the method to accept any arguments but don't care about them.
|
1142
|
-
def invoked(*args)
|
1143
|
-
^^^^
|
1144
|
-
spec/test_app_templates/lib/generators/test_app_generator.rb:3:1: C: Missing top-level class documentation comment.
|
1145
|
-
class TestAppGenerator < Rails::Generators::Base
|
1146
|
-
^^^^^
|
1147
|
-
spec/test_app_templates/lib/generators/test_app_generator.rb:4:15: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
1148
|
-
source_root "spec/test_app_templates"
|
1149
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^
|
1150
|
-
spec/test_app_templates/lib/generators/test_app_generator.rb:7:45: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
1151
|
-
application_yml_file = File.expand_path("../../../../../config/application.yml", __FILE__)
|
1152
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
1153
|
-
spec/test_app_templates/lib/generators/test_app_generator.rb:8:53: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
1154
|
-
application_yml_example_file = File.expand_path("../../../../../config/application.yml.example", __FILE__)
|
1155
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
1156
|
-
spec/test_app_templates/lib/generators/test_app_generator.rb:10:75: C: Space missing after colon.
|
1157
|
-
create_link 'config/application.yml', application_yml_file, symbolic:true
|
1158
|
-
^
|
1159
|
-
spec/test_app_templates/lib/generators/test_app_generator.rb:12:83: C: Space missing after colon.
|
1160
|
-
create_link 'config/application.yml', application_yml_example_file, symbolic:true
|
1161
|
-
^
|
1162
|
-
spec/test_app_templates/lib/generators/test_app_generator.rb:24:1: C: Extra empty line detected at body end.
|
1163
|
-
|
1164
|
-
93 files inspected, 399 offenses detected
|