BigKeeper/big-keeper

View on GitHub

Showing 109 of 109 total issues

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

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

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

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

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

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

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

            def del(path, user, module_name, name, type)
        Severity: Minor
        Found in lib/big_keeper/service/module_service.rb - About 35 mins to fix

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

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

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

                    modules.command :list do |list|
                        list.action do |global_options, options, args|
                        LeanCloudLogger.instance.set_command("spec/list")
                        path = File.expand_path(global_options[:path])
                        version = global_options[:ver]
            Severity: Minor
            Found in lib/big_keeper/command/client.rb and 2 other locations - About 35 mins to fix
            lib/big_keeper/command/client.rb on lines 24..30
            lib/big_keeper/command/spec.rb on lines 29..37

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 36.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

                  spec.command :list do | list |
                    list.action do |global_options, options, args|
                      LeanCloudLogger.instance.set_command("spec/list")
            
                      path = File.expand_path(global_options[:path])
            Severity: Minor
            Found in lib/big_keeper/command/spec.rb and 2 other locations - About 35 mins to fix
            lib/big_keeper/command/client.rb on lines 14..20
            lib/big_keeper/command/client.rb on lines 24..30

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 36.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

                    modules.command :update do |update|
                      update.action do |global_options, options, args|
                        LeanCloudLogger.instance.set_command("spec/list")
                        path = File.expand_path(global_options[:path])
                        version = global_options[:ver]
            Severity: Minor
            Found in lib/big_keeper/command/client.rb and 2 other locations - About 35 mins to fix
            lib/big_keeper/command/client.rb on lines 14..20
            lib/big_keeper/command/spec.rb on lines 29..37

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 36.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Method chose_version has a Cognitive Complexity of 7 (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('.')
                temp_list << 0.to_s if temp_list.size == 2
            Severity: Minor
            Found in lib/big_keeper/util/podfile_detector.rb - About 35 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 find_lastest_tag has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def find_lastest_tag(module_name)
                  username = FileOperator.new.current_username
                  tags_repos_pwd = Array.new
                  tags_spec_list = Array.new
                  tags_module_list = Array.new
            Severity: Minor
            Found in lib/big_keeper/dependency/dep_pod_operator.rb - About 35 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 check_remote_branch_diff has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def check_remote_branch_diff(path, branch, compare_branch)
                  fetch(path)
                  compare_branch_commits = Array.new
                  IO.popen("cd '#{path}';git log --left-right #{branch}...origin/#{compare_branch} --pretty=oneline") do |io|
                    io.each do |line|
            Severity: Minor
            Found in lib/big_keeper/util/git_operator.rb - About 35 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

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                if cur_list[0] >= temp_list[0]
                  if cur_list[1] >= temp_list[1]
                    if cur_list[2] > temp_list[2]
                      return cur_version
                    end
            Severity: Minor
            Found in lib/big_keeper/util/podfile_detector.rb and 1 other location - About 30 mins to fix
            lib/big_keeper/util/lockfile_parser.rb on lines 131..138

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 32.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                  if cur_list[0] >= temp_list[0]
                    if cur_list[1] >= temp_list[1]
                      if cur_list[2] > temp_list[2]
                        return cur_version
                      end
            Severity: Minor
            Found in lib/big_keeper/util/lockfile_parser.rb and 1 other location - About 30 mins to fix
            lib/big_keeper/util/podfile_detector.rb on lines 90..97

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 32.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

                  begin
                    File.open(settings_file, 'r') do |file|
                      file.each_line do |line|
                        temp_file.puts(line)
                      end
            Severity: Minor
            Found in lib/big_keeper/util/gradle_file_operator.rb and 2 other locations - About 25 mins to fix
            lib/big_keeper/util/gradle_file_operator.rb on lines 108..119
            lib/big_keeper/util/gradle_file_operator.rb on lines 205..216

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 31.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

                  begin
                    File.open(build_file, 'r') do |file|
                      file.each_line do |line|
                        temp_file.puts(line)
                      end
            Severity: Minor
            Found in lib/big_keeper/util/gradle_file_operator.rb and 2 other locations - About 25 mins to fix
            lib/big_keeper/util/gradle_file_operator.rb on lines 108..119
            lib/big_keeper/util/gradle_file_operator.rb on lines 160..171

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 31.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

                  begin
                    File.open(build_file, 'r') do |file|
                      file.each_line do |line|
                        temp_file.puts(line)
                      end
            Severity: Minor
            Found in lib/big_keeper/util/gradle_file_operator.rb and 2 other locations - About 25 mins to fix
            lib/big_keeper/util/gradle_file_operator.rb on lines 160..171
            lib/big_keeper/util/gradle_file_operator.rb on lines 205..216

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 31.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Method release_start has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              def self.release_start(path, version, user, modules)
                BigkeeperParser.parse("#{path}/Bigkeeper")
                version = BigkeeperParser.version if version == 'Version in Bigkeeper file'
                modules = release_check_changed_modules(path, user) if (modules.nil? || modules.empty?)
            
            
            Severity: Minor
            Found in lib/big_keeper/command/release/start.rb - About 25 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 release_finish has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              def self.release_finish(path, version, user, modules)
                BigkeeperParser.parse("#{path}/Bigkeeper")
                version = BigkeeperParser.version if version == 'Version in Bigkeeper file'
                modules = release_check_changed_modules(path, user) if (modules.nil? || modules.empty?)
            
            
            Severity: Minor
            Found in lib/big_keeper/command/release/finish.rb - About 25 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_checkout has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def verify_checkout(path, branch_name)
                  Dir.chdir(path) do
                    cmd = "git checkout -b #{branch_name}"
                    if GitOperator.new.has_branch(path, branch_name)
                      cmd = "git checkout #{branch_name}"
            Severity: Minor
            Found in lib/big_keeper/service/git_service.rb - About 25 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_path has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def self.module_path(user_name, module_name)
                  if @@config[:users] \
                    && @@config[:users][user_name] \
                    && @@config[:users][user_name][:mods] \
                    && @@config[:users][user_name][:mods][module_name] \
            Severity: Minor
            Found in lib/big_keeper/util/bigkeeper_parser.rb - About 25 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

            Severity
            Category
            Status
            Source
            Language