Showing 22 of 31 total issues
Method parser_pom
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def parser_pom(pom_url, pom_str)
LicenseAuto.logger.debug("pom_str:\n#{pom_str[0..70]}")
doc = Nokogiri::XML(pom_str).remove_namespaces!
# Source Code Manager
- 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 parser_pom
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parser_pom(pom_url, pom_str)
LicenseAuto.logger.debug("pom_str:\n#{pom_str[0..70]}")
doc = Nokogiri::XML(pom_str).remove_namespaces!
# Source Code Manager
Method get_license_info
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def get_license_info()
possible_ref = @ref || match_versioned_ref
LicenseAuto.logger.debug("possible_ref: #{possible_ref}")
# If possible_ref is nil, the Github API server will return the default branch contents
contents = @server.repos.contents.get(path: '/', ref: possible_ref)
- 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_license_info
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_license_info()
possible_ref = @ref || match_versioned_ref
LicenseAuto.logger.debug("possible_ref: #{possible_ref}")
# If possible_ref is nil, the Github API server will return the default branch contents
contents = @server.repos.contents.get(path: '/', ref: possible_ref)
Method get_license_info
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_license_info()
if @package.version.nil?
begin
@package.version = chose_latest_available_version('*')
rescue Exception => e
Method parse_dependencies
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def parse_dependencies
package_json_files = dependency_file_path_names
if package_json_files.empty?
LicenseAuto.logger.info("#{LANGUAGE}: #{dependency_file_pattern} file not exist")
- 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_dependencies
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def parse_dependencies
# gemfiles = dependency_file_path_names(pattern=gemfile_pattern)
# definition = ::Bundler::Definition.build(gemfiles.first, nil, nil)
# definition.dependencies.each {|dep|
- 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_dependencies
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_dependencies
package_json_files = dependency_file_path_names
if package_json_files.empty?
LicenseAuto.logger.info("#{LANGUAGE}: #{dependency_file_pattern} file not exist")
Method chose_package_server
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def chose_package_server()
begin
@server =
if self.language == 'Golang' and self.server
matcher = Matcher::SourceURL.new(self.server)
- 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_license_info
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def get_license_info()
if @package.version.nil?
begin
@package.version = chose_latest_available_version('*')
rescue Exception => e
- 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_dependencies
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_dependencies
# gemfiles = dependency_file_path_names(pattern=gemfile_pattern)
# definition = ::Bundler::Definition.build(gemfiles.first, nil, nil)
# definition.dependencies.each {|dep|
Method get_license_info
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_license_info()
if @package.version.nil?
begin
@package.version = get_latest_version['number']
rescue Exception => e
Method get_license_info
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_license_info()
license_info = LicenseAuto::LicenseInfoWrapper.new
query_set = select
if query_set.nil?
- 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 chose_package_server
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def chose_package_server()
begin
@server =
if self.language == 'Golang' and self.server
matcher = Matcher::SourceURL.new(self.server)
Method list_dependencies
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def list_dependencies
if resolve_dependencies
deps = Set.new
Dir.chdir(@path) do
cmd = 'mvn dependency:list -T 4 -DincludeScope=runtime'
- 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 list_dependencies
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def list_dependencies(project_name=nil)
Dir.chdir(@path) do
deps = Set.new
cmd = if project_name
"gradle -q #{project_name}:dependencies --configuration runtime"
- 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_license_info
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_license_info()
if @package.version.nil?
begin
@package.version = get_latest_version['number']
rescue Exception => e
- 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_dependencies
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_dependencies
contents = list_contents
if contents.nil?
LicenseAuto.logger.info("Golang dependencies not exist")
return []
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(package, user, repo, ref=nil, auto_pagination=false)
Method list_projects
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def list_projects
cmd = "gradle -q project"
LicenseAuto.logger.debug(@path)
projects = []
Dir.chdir(@path) do
- 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"