BigKeeper/big-keeper

View on GitHub

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
Severity: Minor
Found in lib/big_keeper/util/gradle_file_operator.rb - About 1 hr to fix

    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? &&
    Severity: Minor
    Found in lib/big_keeper/util/podfile_detector.rb - About 1 hr to fix

    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)
    
    
    Severity: Minor
    Found in lib/big_keeper/service/git_service.rb - About 1 hr to fix

    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 |
    Severity: Minor
    Found in lib/big_keeper/util/list_generator.rb - About 1 hr to fix

      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|
      Severity: Minor
      Found in lib/big_keeper/command/client.rb - About 1 hr to fix

        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'
        
        
        Severity: Minor
        Found in lib/big_keeper/command/pod.rb - About 1 hr to fix

          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"
          
          
          Severity: Minor
          Found in lib/big_keeper/util/gradle_file_operator.rb - About 1 hr to fix

            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"
            
            
            Severity: Minor
            Found in lib/big_keeper/util/gradle_file_operator.rb - About 1 hr to fix

              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)
              Severity: Minor
              Found in lib/big_keeper/util/gradle_file_operator.rb - About 1 hr to fix

                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)
                Severity: Minor
                Found in lib/big_keeper/util/gradle_file_operator.rb - About 1 hr to fix

                  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}'"
                  Severity: Minor
                  Found in lib/big_keeper/dependency/dep_pod_operator.rb - About 1 hr to fix

                    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)
                    Severity: Minor
                    Found in lib/big_keeper/model/library_model.rb - About 1 hr to fix

                      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)
                      Severity: Minor
                      Found in lib/big_keeper/util/pod_operator.rb - About 1 hr to fix

                      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|
                      Severity: Minor
                      Found in lib/big_keeper/util/podfile_operator.rb - About 1 hr to fix

                        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')
                        Severity: Minor
                        Found in lib/big_keeper/util/gradle_file_operator.rb - About 1 hr to fix

                          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")
                          
                          
                          Severity: Minor
                          Found in lib/big_keeper/command/feature&hotfix/start.rb - About 1 hr to fix

                            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...")
                            Severity: Minor
                            Found in lib/big_keeper/util/lockfile_parser.rb - About 1 hr to fix

                              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'
                              
                              
                              Severity: Minor
                              Found in lib/big_keeper/util/leancloud_logger.rb - About 1 hr to fix

                              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]
                              Severity: Minor
                              Found in lib/big_keeper/model/podfile_model.rb - About 1 hr to fix

                              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)
                              
                              
                              Severity: Minor
                              Found in lib/big_keeper/service/git_service.rb - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language