Showing 12 of 14 total issues
Method parse_video
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_video(item)
video_id = item['id']
snippet = item['snippet']
statistics = item['statistics'] ? item['statistics'] : {}
details = item['contentDetails']
Method parse_video
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_video(data)
video = ActivePublicResources::ResponseTypes::Video.new
video.id = data['readable_id']
video.title = data['title']
video.description = data['description']
Method parse_video
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_video(data)
video = ActivePublicResources::ResponseTypes::Video.new
video.id = "#{data['uri']}".gsub(/[^\d]/, '').to_i
video.title = data['name']
video.description = data['description'] || "No description found"
Method parse_video
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_video(data)
video = ActivePublicResources::ResponseTypes::Video.new
video.id = data['vkey']
video.title = data['title']
video.description = data['description']
Method symbolize_keys
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def self.symbolize_keys(hash)
hash.inject({}){|result, (key, value)|
new_key = case key
when String then key.to_sym
else key
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method perform_request
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def perform_request(request_criteria)
request_criteria.validate_presence!([:query])
raise StandardError.new("driver has not been initialized properly") unless @client
results = HTTParty.get('https://api.vimeo.com/videos',
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method parse_quiz
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_quiz(data)
quiz = ActivePublicResources::ResponseTypes::Quiz.new
quiz.id = data['id']
quiz.title = data['title']
quiz.description = data['description']
Method initialize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def initialize(args={})
args.each do |k,v|
if k.to_s == 'sort' && !SORTS.include?(v)
raise ArgumentError.new("sort is invalid. Must be in [#{SORTS.join(', ')}]")
end
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method parse_video
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def parse_video(item)
video_id = item['id']
snippet = item['snippet']
statistics = item['statistics'] ? item['statistics'] : {}
details = item['contentDetails']
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method perform_request
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def perform_request(request_criteria)
request_criteria.set_default_criteria!(@default_request_criteria)
unless request_criteria.validate_presence(:query) || request_criteria.validate_presence(:channel)
raise ArgumentError, "You must specify at least a query or channel"
end
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method parse_video
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_video(data)
video = ActivePublicResources::ResponseTypes::Video.new
video.id = data['vkey']
video.title = data['title']
video.description = data['description']
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method parse_video
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_video(data)
video = ActivePublicResources::ResponseTypes::Video.new
video.id = data['readable_id']
video.title = data['title']
video.description = data['description']
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"