Showing 79 of 214 total issues
Method vobject_grammar
has a Cognitive Complexity of 202 (exceeds 5 allowed). Consider refactoring. Open
def vobject_grammar
# properties with value cardinality 1
@cardinality1 = {}
@cardinality1[:ICAL] = Set.new [:PRODID, :VERSION, :CALSCALE, :METHOD, :UID, :LAST_MOD, :URL,
:REFRESH_INTERVAL, :SOURCE, :COLOR]
- 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 paramcheck
has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring. Open
def paramcheck(strict, prop, params, ctx)
errors = []
if params && params[:ALTREP]
case prop
when :COMMENT, :DESCRIPTION, :LOCATION, :RESOURCES, :SUMMARY,
- 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 paramcheck
has a Cognitive Complexity of 110 (exceeds 5 allowed). Consider refactoring. Open
def paramcheck(strict, prop, params, ctx)
errors = []
if params && params[:TYPE]
parse_err(strict, errors, "multiple values for :TYPE parameter of #{prop}", ctx) if params[:TYPE].is_a?(Array) && params[:TYPE].length > 1 && prop != :EMAIL && prop != :ADR && prop != :TEL && prop != :LABEL && prop != :IMPP
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 vobject_grammar
has 414 lines of code (exceeds 25 allowed). Consider refactoring. Open
def vobject_grammar
# properties with value cardinality 1
@cardinality1 = {}
@cardinality1[:ICAL] = Set.new [:PRODID, :VERSION, :CALSCALE, :METHOD, :UID, :LAST_MOD, :URL,
:REFRESH_INTERVAL, :SOURCE, :COLOR]
Method paramcheck
has a Cognitive Complexity of 101 (exceeds 5 allowed). Consider refactoring. Open
def paramcheck(strict, prop, params, ctx)
errors = []
if params && params[:TYPE]
case prop
when :FN, :NICKNAME, :PHOTO, :ADR, :TEL, :EMAIL, :IMPP, :LANG, :TZ,
- 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 typematch
has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring. Open
def typematch(strict, key, params, component, value, ctx)
errors = []
errors << property_parent(strict, key, component, value, ctx)
ctx1 = Rsec::ParseContext.new value, "source"
case 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 timezoneadjust
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
def timezoneadjust(x)
if x[:TZID].nil? || x[:TZID].empty?
return x
end
# TODO deal with unregistered timezones
- 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 paramcheck
has 231 lines of code (exceeds 25 allowed). Consider refactoring. Open
def paramcheck(strict, prop, params, ctx)
errors = []
if params && params[:ALTREP]
case prop
when :COMMENT, :DESCRIPTION, :LOCATION, :RESOURCES, :SUMMARY,
File typegrammars.rb
has 548 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rsec"
require "set"
require "uri"
require "date"
require "tzinfo"
File grammar.rb
has 546 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rsec"
require "set"
require "uri"
require "date"
require "tzinfo"
Method typematch
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
def typematch(strict, key, params, _component, value)
errors = []
ctx1 = Rsec::ParseContext.new value, "source"
case key
when :VERSION
- 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 address
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
def address
text = C::TEXT3
component = seq(text << ",".r, lazy { component }) do |(a, b)|
[unescape(a), b].flatten
end | text.map { |t| [unescape(t)] }
- 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 paramcheck
has 212 lines of code (exceeds 25 allowed). Consider refactoring. Open
def paramcheck(strict, prop, params, ctx)
errors = []
if params && params[:TYPE]
case prop
when :FN, :NICKNAME, :PHOTO, :ADR, :TEL, :EMAIL, :IMPP, :LANG, :TZ,
File propertyvalue.rb
has 505 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "vobject"
require "vobject/propertyvalue"
module Vobject
module Vcalendar
Method typematch
has 193 lines of code (exceeds 25 allowed). Consider refactoring. Open
def typematch(strict, key, params, component, value, ctx)
errors = []
errors << property_parent(strict, key, component, value, ctx)
ctx1 = Rsec::ParseContext.new value, "source"
case key
File typegrammars.rb
has 488 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rsec"
require "set"
require "uri"
require "date"
include Rsec::Helpers
Method vobject_grammar
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
def vobject_grammar
# properties with value cardinality 1
@cardinality1 = {}
@cardinality1[:PARAM] = Set.new [:VALUE]
@cardinality1[:PROP] = Set.new [:KIND, :N, :BDAY, :ANNIVERSARY, :GENDER, :PRODID, :REV, :UID, :BIRTHPLACE, :DEATHPLACE, :DEATHDATE]
File typegrammars.rb
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rsec"
require "set"
require "uri"
require "date"
include Rsec::Helpers
Class Typegrammars
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
class Typegrammars
class << self
# property value types, each defining their own parser
def recur
freq = /SECONDLY/i.r | /MINUTELY/i.r | /HOURLY/i.r | /DAILY/i.r |
Method vobject_grammar
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def vobject_grammar
# properties with value cardinality 1
@cardinality1 = {}
@cardinality1[:PARAM] = Set.new [:VALUE]
@cardinality1[:PROP] = Set.new [:KIND, :N, :BDAY, :ANNIVERSARY, :GENDER, :PRODID, :REV, :UID]
- 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"