Showing 7 of 7 total issues
Method find
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.find(version)
if Windows::SoftwareDevelopmentKit::VERSIONS.include?(version)
# TODO(mtwilliams): Select the 64-bit and ARM host variants when
# applicable, i.e. when running on 64-bit or ARM.
Method find
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def self.find(version)
if Windows::SoftwareDevelopmentKit::VERSIONS.include?(version)
# TODO(mtwilliams): Select the 64-bit and ARM host variants when
# applicable, i.e. when running on 64-bit or ARM.
- 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 find
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.find(product, version)
if VisualStudio::Product::NAMES.include?(product)
name = Helpers::PrettyString.new product,
pretty: VisualStudio::VERSION_TO_PRETTY_NAME[version]
Method environment
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def environment(opts={})
# TODO(mtwilliams): Raise an exception.
return nil unless @name.to_s == 'VC'
target = opts[:target] || {platform: :windows,
- 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 find
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def self.find(product, version)
if VisualStudio::Product::NAMES.include?(product)
name = Helpers::PrettyString.new product,
pretty: VisualStudio::VERSION_TO_PRETTY_NAME[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 environment
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def environment(opts={})
# TODO(mtwilliams): Raise an exception.
return nil unless @name.to_s == 'VC'
target = opts[:target] || {platform: :windows,
Method merge
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.merge(base, overlay)
# We merge case insensitively, because Windows. We treat |base| case as canonical
# unless the variable is only named by |overlay|.
cased = (overlay.keys + base.keys).uniq.map{|key| [key.upcase, key]}.to_h
- 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"