BigKeeper/big-keeper

View on GitHub

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

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

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

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

          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)
          Severity: Minor
          Found in lib/big_keeper/util/lockfile_parser.rb - About 55 mins 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 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')
          Severity: Minor
          Found in lib/big_keeper/util/gradle_file_operator.rb - About 55 mins 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 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)
          Severity: Minor
          Found in lib/big_keeper/command/feature&hotfix/list.rb - About 45 mins to fix

            Method start has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def self.start(path, version, user, name, modules, type)
            Severity: Minor
            Found in lib/big_keeper/command/feature&hotfix/start.rb - About 45 mins to fix

              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
              Severity: Minor
              Found in lib/big_keeper/util/code_operator.rb - About 45 mins 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_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)
              Severity: Minor
              Found in lib/big_keeper/service/git_service.rb - About 45 mins 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_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)
              Severity: Minor
              Found in lib/big_keeper/service/git_service.rb - About 45 mins 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 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
              Severity: Minor
              Found in lib/big_keeper/util/lockfile_parser.rb - About 45 mins 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 push has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def push(path, user, module_name, home_branch_name, type, comment)
              Severity: Minor
              Found in lib/big_keeper/service/module_service.rb - About 45 mins to fix

                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
                Severity: Major
                Found in lib/big_keeper/model/library_model.rb - About 45 mins to fix

                  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 |
                  Severity: Minor
                  Found in lib/big_keeper/service/git_service.rb - About 45 mins 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 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/)
                  Severity: Minor
                  Found in lib/big_keeper/util/podfile_module.rb - About 45 mins 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 module_info has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def module_info(module_path, home_branch_name, user, type, module_name, version)
                  Severity: Minor
                  Found in lib/big_keeper/service/module_service.rb - About 45 mins to fix

                    Method release_module_finish has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      def self.release_module_finish(path, version, user, module_name, spec)
                    Severity: Minor
                    Found in lib/big_keeper/command/release/module.rb - About 35 mins to fix

                      Method switch_to has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        def self.switch_to(path, version, user, full_name, type)
                      Severity: Minor
                      Found in lib/big_keeper/command/feature&hotfix/switch.rb - About 35 mins to fix

                        Method release_start has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def release_start(path, user, modules, module_name, version)
                        Severity: Minor
                        Found in lib/big_keeper/service/module_service.rb - About 35 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language