Showing 748 of 748 total issues
Similar blocks of code found in 9 locations. Consider refactoring. Open
database_user "grant database access for watcher database user" do
connection db_settings[:connection]
username node[:watcher][:db][:user]
password node[:watcher][:db][:password]
database_name node[:watcher][:db][:database]
- Read upRead up
- Create a ticketCreate a ticket
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 60.
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 9 locations. Consider refactoring. Open
database_user "grant database access for designate database user" do
connection db_settings[:connection]
username node[:designate][:db][:user]
password node[:designate][:db][:password]
database_name node[:designate][:db][:database]
- Read upRead up
- Create a ticketCreate a ticket
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 60.
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
db_synced = node[:neutron][:db_synced_apic_gbp]
is_founder = CrowbarPacemakerHelper.is_cluster_founder?(node)
execute "gbp-db-manage upgrade head" do
user node[:neutron][:user]
group node[:neutron][:group]
- Read upRead up
- Create a ticketCreate a ticket
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 60.
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
Method action_grant
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def action_grant
db_name = new_resource.database_name || "*"
tbl_name = new_resource.table || "*"
username = client.escape(new_resource.username)
- Create a ticketCreate a ticket
Method role_constraints
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def role_constraints
{
"swift-storage" => {
"unique" => false,
"count" => -1,
- Create a ticketCreate a ticket
Method binaryround
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def binaryround(value)
# Keep a multiplier which grows through powers of 1
multiplier = 1
- Create a ticketCreate a ticket
Method run_report
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_report(node)
raise "unable to look up a #{@bc_name} proposal applied to #{node.inspect}" if (proposal = _get_proposal_by_node node).nil?
report_run_uuid = `uuidgen`.strip
report_run = {
- Create a ticketCreate a ticket
Method create_proposal
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_proposal
base = super
base[:attributes][:swift][:cluster_hash] = "%x%s" % [rand(100000),rand(100000)]
- Create a ticketCreate a ticket
Method enable_neutron_networks
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def enable_neutron_networks(attributes, nodename, net_svc, needs_external = true)
if needs_external
net_svc.enable_interface "default", "nova_floating", nodename
attributes["additional_external_networks"].each do |extnet|
net_svc.enable_interface "default", extnet, nodename
- Create a ticketCreate a ticket
Method create_proposal
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_proposal
@logger.debug("Manila create_proposal: entering")
base = super
nodes = NodeObject.all
- Create a ticketCreate a ticket
Method clear_dispersion_reports
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def clear_dispersion_reports
def delete_file(file_name)
File.delete(file_name) if File.exist?(file_name)
end
- Create a ticketCreate a ticket
Method clear_test_runs
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def clear_test_runs
def delete_file(file_name)
File.delete(file_name) if File.exist?(file_name)
end
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
def upgrade(ta, td, a, d)
# new defaults
a["volume_defaults"]["eqlx"]["ssh_conn_timeout"] = \
ta["volume_defaults"]["eqlx"]["ssh_conn_timeout"]
a["volume_defaults"]["eqlx"].delete "eqlx_cli_timeout"
- Read upRead up
- Create a ticketCreate a ticket
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 56.
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
api: {
bind_host: if !ha_enabled && node[:octavia][:api][:bind_open_address]
"0.0.0.0"
else
@admin_ip
- Read upRead up
- Create a ticketCreate a ticket
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 56.
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 downgrade ta, td, a, d
a["volume_defaults"]["vmware"]["volume"] = a["volume_defaults"]["vmware"]["volume_folder"]
a["volume_defaults"]["vmware"].delete("volume_folder")
a["volumes"].each do |volume|
- Read upRead up
- Create a ticketCreate a ticket
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 56.
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
api: {
bind_host: if !ha_enabled && node[:designate][:api][:bind_open_address]
"0.0.0.0"
else
@ip
- Read upRead up
- Create a ticketCreate a ticket
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 56.
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
Method upgrade
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def upgrade ta, td, a, d
# Old proposals had passwords created in the cookbook, so we need to migrate
# them in the proposal and in the role. We use a class variable to set the
# same password in the proposal and in the role.
service = ServiceObject.new "fake-logger"
- Create a ticketCreate a ticket
Method get_neutron_physnets
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.get_neutron_physnets(node, external_networks)
# This assumes that "nova_fixed" will always be on the physnet called
# "physnet1" in neutron.
# Also we don't allow to put 2 external networks on the same neutron
# physnet.
- Create a ticketCreate a ticket
Method scan_available_timezones
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def scan_available_timezones(tzdir)
# There should be an /etc/localtime zoneinfo file that is a link to
# (or a copy of) a timezone data file under tzdir, which should have
# been installed under the "share" directory by the tzdata package.
#
- Create a ticketCreate a ticket
Method validate_proposal_after_save
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate_proposal_after_save(proposal)
validate_one_for_role proposal, "database-server"
attributes = proposal["attributes"][@bc_name]
deployment = proposal["deployment"][@bc_name]
- Create a ticketCreate a ticket