File configure.rb
has 1749 lines of code (exceeds 250 allowed). Consider refactoring. Open
require './rakelib/configure'
require './rakelib/release'
require './rakelib/build_signature'
require 'rbconfig'
require 'tempfile'
Class Configure
has 82 methods (exceeds 20 allowed). Consider refactoring. Open
class Configure
# Default settings only. All code that may depend on user-selected options
# must run after options are processed.
def initialize(root)
Method write_configure_files
has 197 lines of code (exceeds 25 allowed). Consider refactoring. Open
def write_configure_files
@log.write "\nWriting configuration files..."
@bin_links.delete @program_name
Method options
has 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
def options
@options = Rubinius::Options.new "Usage: configure [options]", 30
o = @options
o.left_align
Method set_filesystem_paths
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def set_filesystem_paths
@prefixdir = @prefixdir ? expand_install_dir(@prefixdir) : @sourcedir
if @appdir
dir = expand_install_dir @appdir
- 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 check_tools
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def check_tools
@cc ||= ENV['CC'] || default_cc
@cxx ||= ENV['CXX'] || default_cxx
check_tool_version @cc, '-dumpversion', [4, 1]
- 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 setup_llvm
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def setup_llvm
@log.print " Checking for 'llvm-config': "
config = @llvm_configure
if !config
- 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 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(root)
@log = Logger.new "configure.log"
@command_line = ARGV.dup
@log.log "Command line: #{@command_line.join(" ").inspect}"
Method write_configure_files
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def write_configure_files
@log.write "\nWriting configuration files..."
@bin_links.delete @program_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 detect_functions
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def detect_functions
if has_function("clock_gettime", ["time.h"])
@defines << "HAVE_CLOCK_GETTIME"
end
- 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 download
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def download(url, full_path, follows=0)
begin
dir = File.dirname full_path
Dir.mkdir dir unless File.exist? dir
- 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 detect_functions
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
def detect_functions
if has_function("clock_gettime", ["time.h"])
@defines << "HAVE_CLOCK_GETTIME"
end
Method setup_platform
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setup_platform
@ldsharedxx = "#{@cxx} -shared"
@ldshared = "#{@cc} -shared"
@include_dirs.each do |d|
Method unpack_gems
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def unpack_gems(source, destination, list)
FileUtils.mkdir_p destination unless File.directory? destination
Dir.chdir destination do
list.each do |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 run
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
unless ENV["RBX_SUPRESS_DEPRECATION"]
@log.deprecated "\n\n'configure' is deprecated and will be removed in the future.\n" \
"Use 'build.sh' to configure, build, package, and install Rubinius.\n\n\n"
end
Method detect_headers
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def detect_headers
unless @features["vendor-zlib"].value
unless has_header("zlib.h")
failure "zlib.h is required"
end
- 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 set_filesystem_paths
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_filesystem_paths
@prefixdir = @prefixdir ? expand_install_dir(@prefixdir) : @sourcedir
if @appdir
dir = expand_install_dir @appdir
Method download
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def download(url, full_path, follows=0)
begin
dir = File.dirname full_path
Dir.mkdir dir unless File.exist? dir
Method setup_llvm
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setup_llvm
@log.print " Checking for 'llvm-config': "
config = @llvm_configure
if !config
Method check_tools
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_tools
@cc ||= ENV['CC'] || default_cc
@cxx ||= ENV['CXX'] || default_cxx
check_tool_version @cc, '-dumpversion', [4, 1]
Method detect_headers
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def detect_headers
unless @features["vendor-zlib"].value
unless has_header("zlib.h")
failure "zlib.h is required"
end
Method process
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process
set_system_commands
enable_features
detect_build_dirs
Method run
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def run
unless ENV["RBX_SUPRESS_DEPRECATION"]
@log.deprecated "\n\n'configure' is deprecated and will be removed in the future.\n" \
"Use 'build.sh' to configure, build, package, and install Rubinius.\n\n\n"
end
- 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 options
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def options
@options = Rubinius::Options.new "Usage: configure [options]", 30
o = @options
o.left_align
- 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 setup_codedb
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def setup_codedb
@log.write "\nSetting up CodeDB..."
dir = "#{@builddir}#{@codedbdir}"
codedb_cache = "#{dir}/cache"
- 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 setup_codetools
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def setup_codetools
@log.write "\nSetting up codetools..."
codetools_cache = "rubinius-codetools-cache"
cache_bzip = "#{codetools_cache}.bz2"
- 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 setup_stdlib
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def setup_stdlib
@log.write "\nSetting up stdlib..."
stdlib_cache = "rubinius-stdlib-cache"
cache_bzip = "#{stdlib_cache}.bz2"
- 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 check_program
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_program(run=true, *arguments)
begin
basename = "rbx-configure-test"
source = basename + ".cpp"
File.open source, "wb" do |f|
Method detect_libc_name
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def detect_libc_name
return if @libc
@log.print "Checking for libc version: "
- 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 fetch_gems
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def fetch_gems
@log.write "\nFetching gems..."
failed = false
Dir.chdir @gems_cache do
- 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 detect_features
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def detect_features
# Default on *BSD is no execinfo
if @bsd and @features["execinfo"].configured.nil?
@features["execinfo"].configured = false
end
- 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
Avoid too many return
statements within this method. Open
return true
Avoid too many return
statements within this method. Open
return false
Method get_system_name
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_system_name
return unless @os =~ /linux/
return unless File.exist? "/etc/issue"
data = IO.readlines("/etc/issue").first
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
def setup_codetools
@log.write "\nSetting up codetools..."
codetools_cache = "rubinius-codetools-cache"
cache_bzip = "#{codetools_cache}.bz2"
- Read upRead up
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 62.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
def setup_stdlib
@log.write "\nSetting up stdlib..."
stdlib_cache = "rubinius-stdlib-cache"
cache_bzip = "#{stdlib_cache}.bz2"
- Read upRead up
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 62.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
def detect_tr1
@log.print "Checking for tr1: "
status = check_program(false) do |f|
src = <<-EOP
- Read upRead up
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 29.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
def detect_tr1_hash
@log.print "Checking for tr1/hash definition: "
status = check_program(false) do |f|
src = <<-EOP
- Read upRead up
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 29.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
def detect_aarch64
print "Checking for aarch64: "
status = check_program do |f|
src = <<-EOP
- Read upRead up
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 26.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
def detect_x86
print "Checking for x86_64: "
status = check_program do |f|
src = <<-EOP
- Read upRead up
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 26.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76