Showing 82 of 109 total issues
Method verify_home_branch
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def verify_home_branch(path, branch_name, type)
Logger.highlight('Sync local branchs from remote, waiting...')
git = GitOperator.new
git.fetch(path)
Method update
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.update(path, user, modules, type)
begin
# Parse Bigkeeper file
BigkeeperParser.parse("#{path}/Bigkeeper")
branch_name = GitOperator.new.current_branch(path)
Method find_and_lock
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def find_and_lock(podfile, dictionary)
temp_file = Tempfile.new('.Podfile.tmp', :encoding => 'UTF-8')
begin
File.open(podfile, 'r') do |file|
file.each_line do |line|
Method get_unlock_pod_list
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_unlock_pod_list(is_all)
result = {}
pod_parser = PodfileParser.instance
#podfile 中 unlock pods
unlock_pods = pod_parser.get_unlock_pod_list
Method deal_pod
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def deal_pod(s)
pod_name = get_lock_podname(s)
return if pod_name == nil
pod_version = get_lock_version(s)
if self.pods.keys.include?(pod_name)
- 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 recover_bigkeeper_config_file
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def recover_bigkeeper_config_file(bigkeeper_config_file)
if !File.exist?(bigkeeper_config_file)
return
end
temp_file = Tempfile.new('.bigkeeper_config.tmp', :encoding => 'UTF-8')
- 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_module_info
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.get_module_info(path, user, type, version, home_branches, is_print_log)
Method start
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.start(path, version, user, name, modules, type)
Method in_note_code
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def in_note_code(line_hash)
line = line_hash["line"]
in_note = line_hash["in_note"]
line = line.strip
if in_note
- 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 verify_push
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def verify_push(path, comment, branch_name, name)
git = GitOperator.new
if git.has_changes(path) || git.has_commits(path, branch_name)
git.commit(path, comment) if git.has_changes(path)
- 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 verify_special_branch
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def verify_special_branch(path, name)
git = GitOperator.new
if git.has_remote_branch(path, name)
if git.has_local_branch(path, name)
- 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_version
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def chose_version(cur_version,temp_version)
# p "cur:#{cur_version},temp:#{temp_version}"
cur_list = cur_version.split('.')
temp_list = temp_version.split('.')
cur_list << 0.to_s if cur_list.size == 2
- 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 push
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def push(path, user, module_name, home_branch_name, type, comment)
Avoid deeply nested control flow statements. Open
if keyword.include?(".h") && line.include?("import") && line.include?("/"+keyword+">")
dependence_library_name = line[line.index("<")+1...line.index("/"+keyword+">")]
if dependence_library_name == library_name
tip = " [file]:"+File.basename(file_path)+" [line]: "+line.strip+" [keyword]: "+keyword
is_dependence = true
Method branchs_with_type
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def branchs_with_type(path, type)
branchs = []
Dir.chdir(path) do
IO.popen('git branch -a') do | io |
io.each do | line |
- 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 deal_module_info
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def deal_module_info
podfile_lines = File.readlines("#{@main_path}/bigKeeperPodInfo.tmp", :encoding => 'UTF-8')
Logger.highlight("Analyzing modules info...") unless podfile_lines.size.zero?
podfile_lines.collect do |sentence|
if sentence =~(/pod/)
- 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 module_info
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def module_info(module_path, home_branch_name, user, type, module_name, version)
Method release_module_finish
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.release_module_finish(path, version, user, module_name, spec)
Method switch_to
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.switch_to(path, version, user, full_name, type)
Method release_start
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def release_start(path, user, modules, module_name, version)