Showing 9 of 17 total issues
Method tracking_code_source
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def tracking_code_source
if !source.nil? && !organization.nil? && !client.nil?
%{
<!-- Crowdskout -->
<script>
Method build_url
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def build_url(url, params = nil)
if params.respond_to? :each
params.each do |key, value|
# Convert dates to CC date format
if value.respond_to? :iso8601
- 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 create
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.create(props)
obj = Profile.new
obj.collections = []
if props
props.each do |key, value|
- 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 create
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.create(props)
obj = Item.new
obj.id = 0
obj.fields = []
if props
- 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 create
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.create(props)
obj = Attribute.new
if props
props.each do |key, value|
if key.downcase == 'options'
- 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 create
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.create(props)
obj = FieldOptions.new
if props
props.each do |key, value|
if key.downcase == 'options'
- 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
Consider simplifying this complex logical expression. Open
if @client_id.nil? || @client_id == '' || @client_secret.nil? || @client_secret.nil? || @redirect_uri.nil? || @redirect_uri == ''
raise ArgumentError.new "Either api_key, api_secret or redirect_uri is missing in explicit call or configuration."
end
Method get_access_token
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_access_token(code)
params = {
:grant_type => Util::Config.get('auth.authorization_code_grant_type'),
:client_id => @client_id,
:client_secret => @client_secret,
- 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 get_value
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_value(index, value)
index = index.is_a?(Array) ? index : [index]
key = index.shift.to_sym
value.is_a?(Hash) and value[key] and value[key].is_a?(Hash) ?
get_value(index, value[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"