Showing 82 of 109 total issues
Method update_module_version_name
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_module_version_name(build_file, version_name)
temp_file = Tempfile.new('.build.gradle.tmp')
isModifyPom = false
isBigkeeperScript = false
isBigkeeperBackupScript = false
Method deal_podfile_line
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def deal_podfile_line(sentence)
return unless !sentence.strip.start_with?("#")
if sentence.strip.include?('pod ')
pod_model = PodfileModel.new(sentence)
if !pod_model.name.empty? &&
- 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_rebase
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def verify_rebase(path, branch_name, name)
# pull rebased branch
pull(path, branch_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 to_json
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.to_json(home_branches, module_info_list, version)
json_array = []
print_all = version == "all versions"
home_branches = home_branches.uniq
home_branches.each do | home_branch_name |
Method client_command
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.client_command
desc 'API for bigkeeper-client.'
command :client do | c |
c.desc 'Commands about operate modules.'
c.command :modules do |modules|
Method pod_command
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.pod_command
desc 'Podfile operation'
command :podfile do |podfile|
podfile.desc 'Podfile'
Method update_module_build
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_module_build(build_file, module_name, depend_modules, version_name)
module_full_path = BigkeeperParser.module_full_path(@path, @user, module_name)
cache_path = File.expand_path("#{module_full_path}/.bigkeeper")
big_build_file = "#{cache_path}/bigkeeper_build.gradle"
Method update_module_settings
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_module_settings(module_name, settings_file, depend_modules)
module_full_path = BigkeeperParser.module_full_path(@path, @user, module_name)
cache_path = File.expand_path("#{module_full_path}/.bigkeeper")
big_settings_file = "#{cache_path}/bigkeeper_settings.gradle"
Method update_home_settings
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_home_settings(settings_file, depend_modules)
cache_path = File.expand_path("#{@path}/.bigkeeper")
big_settings_file = "#{cache_path}/bigkeeper_settings.gradle"
if depend_modules.empty? && !File.exist?(big_settings_file)
Method update_home_build
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_home_build(build_file, depend_modules, version_name)
cache_path = File.expand_path("#{@path}/.bigkeeper")
big_build_file = "#{cache_path}/bigkeeper_build.gradle"
if depend_modules.empty? && !File.exist?(big_build_file)
Method generate_module_config
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate_module_config(line, module_name, module_operate_type)
line.sub(/(\s*)pod(\s*)('|")#{module_name}((\/[_a-zA-Z0-9]+)?)('|")([\s\S]*)/){
if ModuleOperateType::ADD == module_operate_type
module_path = BigkeeperParser.module_path(@user, module_name)
"#{$1}pod '#{module_name}#{$4}', :path => '#{module_path}'"
Method get_all_public_file
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_all_public_file(path)
all_header = FileOperator.find_all_header_file("#{path}/Pods/#{@name}")
for file_path in all_header do
@header_file_list[@header_file_list.size] = file_path
file_name = File.basename(file_path)
Method pod_repo_push
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def self.pod_repo_push(path, module_name, source, version)
Logger.highlight(%Q(Start Pod repo push #{module_name}))
Dir.chdir(path) do
command = ""
p BigkeeperParser.source_spec_name(module_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 podspec_change
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def podspec_change(podspec_file, version, module_name)
temp_file = Tempfile.new(".#{module_name}.podspec", :encoding => 'UTF-8')
has_change = false
begin
File.open(podspec_file, 'r', :encoding => 'UTF-8') do |file|
Method recover_bigkeeper_config_file
has 30 lines of code (exceeds 25 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')
Method start
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.start(path, version, user, name, modules, type)
begin
# Parse Bigkeeper file
BigkeeperParser.parse("#{path}/Bigkeeper")
Method parse
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse(main_path)
self.main_path = main_path
$mode = 'PODS'
podfile_lock_lines = File.readlines("#{main_path}/Podfile.lock", :encoding => 'UTF-8')
Logger.highlight("Analyzing Podfile.lock...")
Method end_log
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def end_log(is_success, is_show_log)
@end_timestamp = Time.new.to_i
@is_success = is_success
@version = BigkeeperParser.version if @version == 'Version in Bigkeeper file'
- 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 initialize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def initialize(sentence)
if sentence.include?('#')
list = sentence.split('#')
@comment = list[1]
sentence = list[0]
- 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_rebase
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def verify_rebase(path, branch_name, name)
# pull rebased branch
pull(path, branch_name)