tombuildsstuff/sensu-plugins-azurerm

View on GitHub

Showing 18 of 25 total issues

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

class CheckAzureRMCoresDUsage < Sensu::Plugin::Check::CLI
  include SensuPluginsAzureRM

  option :tenant_id,
         description: 'ARM Tenant ID. Either set ENV[\'ARM_TENANT_ID\'] or provide it as an option',
Severity: Major
Found in bin/check-azurerm-cores-d-usage.rb and 14 other locations - About 5 hrs to fix
bin/check-azurerm-core-usage.rb on lines 50..121
bin/check-azurerm-cores-ds-usage.rb on lines 50..121
bin/check-azurerm-cores-dsv2-usage.rb on lines 50..121
bin/check-azurerm-cores-dv2-usage.rb on lines 50..121
bin/check-azurerm-cores-f-usage.rb on lines 51..122
bin/check-azurerm-cores-fs-usage.rb on lines 50..121
bin/check-azurerm-load-balancers-usage.rb on lines 50..121
bin/check-azurerm-network-interfaces-usage.rb on lines 50..121
bin/check-azurerm-network-security-groups-usage.rb on lines 50..121
bin/check-azurerm-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-route-tables-usage.rb on lines 50..121
bin/check-azurerm-static-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-virtual-machines-usage.rb on lines 50..121
bin/check-azurerm-virtual-networks-usage.rb on lines 50..121

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 180.

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 15 locations. Consider refactoring.
Open

class CheckAzureRMNetworkInterfacesUsage < Sensu::Plugin::Check::CLI
  include SensuPluginsAzureRM

  option :tenant_id,
         description: 'ARM Tenant ID. Either set ENV[\'ARM_TENANT_ID\'] or provide it as an option',
Severity: Major
Found in bin/check-azurerm-network-interfaces-usage.rb and 14 other locations - About 5 hrs to fix
bin/check-azurerm-core-usage.rb on lines 50..121
bin/check-azurerm-cores-d-usage.rb on lines 50..121
bin/check-azurerm-cores-ds-usage.rb on lines 50..121
bin/check-azurerm-cores-dsv2-usage.rb on lines 50..121
bin/check-azurerm-cores-dv2-usage.rb on lines 50..121
bin/check-azurerm-cores-f-usage.rb on lines 51..122
bin/check-azurerm-cores-fs-usage.rb on lines 50..121
bin/check-azurerm-load-balancers-usage.rb on lines 50..121
bin/check-azurerm-network-security-groups-usage.rb on lines 50..121
bin/check-azurerm-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-route-tables-usage.rb on lines 50..121
bin/check-azurerm-static-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-virtual-machines-usage.rb on lines 50..121
bin/check-azurerm-virtual-networks-usage.rb on lines 50..121

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 180.

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 15 locations. Consider refactoring.
Open

class CheckAzureRMCoreUsage < Sensu::Plugin::Check::CLI
  include SensuPluginsAzureRM

  option :tenant_id,
         description: 'ARM Tenant ID. Either set ENV[\'ARM_TENANT_ID\'] or provide it as an option',
Severity: Major
Found in bin/check-azurerm-core-usage.rb and 14 other locations - About 5 hrs to fix
bin/check-azurerm-cores-d-usage.rb on lines 50..121
bin/check-azurerm-cores-ds-usage.rb on lines 50..121
bin/check-azurerm-cores-dsv2-usage.rb on lines 50..121
bin/check-azurerm-cores-dv2-usage.rb on lines 50..121
bin/check-azurerm-cores-f-usage.rb on lines 51..122
bin/check-azurerm-cores-fs-usage.rb on lines 50..121
bin/check-azurerm-load-balancers-usage.rb on lines 50..121
bin/check-azurerm-network-interfaces-usage.rb on lines 50..121
bin/check-azurerm-network-security-groups-usage.rb on lines 50..121
bin/check-azurerm-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-route-tables-usage.rb on lines 50..121
bin/check-azurerm-static-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-virtual-machines-usage.rb on lines 50..121
bin/check-azurerm-virtual-networks-usage.rb on lines 50..121

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 180.

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 15 locations. Consider refactoring.
Open

class CheckAzureRMCoresDv2Usage < Sensu::Plugin::Check::CLI
  include SensuPluginsAzureRM

  option :tenant_id,
         description: 'ARM Tenant ID. Either set ENV[\'ARM_TENANT_ID\'] or provide it as an option',
Severity: Major
Found in bin/check-azurerm-cores-dv2-usage.rb and 14 other locations - About 5 hrs to fix
bin/check-azurerm-core-usage.rb on lines 50..121
bin/check-azurerm-cores-d-usage.rb on lines 50..121
bin/check-azurerm-cores-ds-usage.rb on lines 50..121
bin/check-azurerm-cores-dsv2-usage.rb on lines 50..121
bin/check-azurerm-cores-f-usage.rb on lines 51..122
bin/check-azurerm-cores-fs-usage.rb on lines 50..121
bin/check-azurerm-load-balancers-usage.rb on lines 50..121
bin/check-azurerm-network-interfaces-usage.rb on lines 50..121
bin/check-azurerm-network-security-groups-usage.rb on lines 50..121
bin/check-azurerm-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-route-tables-usage.rb on lines 50..121
bin/check-azurerm-static-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-virtual-machines-usage.rb on lines 50..121
bin/check-azurerm-virtual-networks-usage.rb on lines 50..121

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 180.

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 15 locations. Consider refactoring.
Open

class CheckAzureRMCoresDSUsage < Sensu::Plugin::Check::CLI
  include SensuPluginsAzureRM

  option :tenant_id,
         description: 'ARM Tenant ID. Either set ENV[\'ARM_TENANT_ID\'] or provide it as an option',
Severity: Major
Found in bin/check-azurerm-cores-ds-usage.rb and 14 other locations - About 5 hrs to fix
bin/check-azurerm-core-usage.rb on lines 50..121
bin/check-azurerm-cores-d-usage.rb on lines 50..121
bin/check-azurerm-cores-dsv2-usage.rb on lines 50..121
bin/check-azurerm-cores-dv2-usage.rb on lines 50..121
bin/check-azurerm-cores-f-usage.rb on lines 51..122
bin/check-azurerm-cores-fs-usage.rb on lines 50..121
bin/check-azurerm-load-balancers-usage.rb on lines 50..121
bin/check-azurerm-network-interfaces-usage.rb on lines 50..121
bin/check-azurerm-network-security-groups-usage.rb on lines 50..121
bin/check-azurerm-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-route-tables-usage.rb on lines 50..121
bin/check-azurerm-static-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-virtual-machines-usage.rb on lines 50..121
bin/check-azurerm-virtual-networks-usage.rb on lines 50..121

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 180.

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 15 locations. Consider refactoring.
Open

class CheckAzureRMPublicIPAddressesUsage < Sensu::Plugin::Check::CLI
  include SensuPluginsAzureRM

  option :tenant_id,
         description: 'ARM Tenant ID. Either set ENV[\'ARM_TENANT_ID\'] or provide it as an option',
Severity: Major
Found in bin/check-azurerm-public-ip-addresses-usage.rb and 14 other locations - About 5 hrs to fix
bin/check-azurerm-core-usage.rb on lines 50..121
bin/check-azurerm-cores-d-usage.rb on lines 50..121
bin/check-azurerm-cores-ds-usage.rb on lines 50..121
bin/check-azurerm-cores-dsv2-usage.rb on lines 50..121
bin/check-azurerm-cores-dv2-usage.rb on lines 50..121
bin/check-azurerm-cores-f-usage.rb on lines 51..122
bin/check-azurerm-cores-fs-usage.rb on lines 50..121
bin/check-azurerm-load-balancers-usage.rb on lines 50..121
bin/check-azurerm-network-interfaces-usage.rb on lines 50..121
bin/check-azurerm-network-security-groups-usage.rb on lines 50..121
bin/check-azurerm-route-tables-usage.rb on lines 50..121
bin/check-azurerm-static-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-virtual-machines-usage.rb on lines 50..121
bin/check-azurerm-virtual-networks-usage.rb on lines 50..121

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 180.

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 15 locations. Consider refactoring.
Open

class CheckAzureRMVirtualNetworksUsage < Sensu::Plugin::Check::CLI
  include SensuPluginsAzureRM

  option :tenant_id,
         description: 'ARM Tenant ID. Either set ENV[\'ARM_TENANT_ID\'] or provide it as an option',
Severity: Major
Found in bin/check-azurerm-virtual-networks-usage.rb and 14 other locations - About 5 hrs to fix
bin/check-azurerm-core-usage.rb on lines 50..121
bin/check-azurerm-cores-d-usage.rb on lines 50..121
bin/check-azurerm-cores-ds-usage.rb on lines 50..121
bin/check-azurerm-cores-dsv2-usage.rb on lines 50..121
bin/check-azurerm-cores-dv2-usage.rb on lines 50..121
bin/check-azurerm-cores-f-usage.rb on lines 51..122
bin/check-azurerm-cores-fs-usage.rb on lines 50..121
bin/check-azurerm-load-balancers-usage.rb on lines 50..121
bin/check-azurerm-network-interfaces-usage.rb on lines 50..121
bin/check-azurerm-network-security-groups-usage.rb on lines 50..121
bin/check-azurerm-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-route-tables-usage.rb on lines 50..121
bin/check-azurerm-static-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-virtual-machines-usage.rb on lines 50..121

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 180.

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 15 locations. Consider refactoring.
Open

class CheckAzureRMVMUsage < Sensu::Plugin::Check::CLI
  include SensuPluginsAzureRM

  option :tenant_id,
         description: 'ARM Tenant ID. Either set ENV[\'ARM_TENANT_ID\'] or provide it as an option',
Severity: Major
Found in bin/check-azurerm-virtual-machines-usage.rb and 14 other locations - About 5 hrs to fix
bin/check-azurerm-core-usage.rb on lines 50..121
bin/check-azurerm-cores-d-usage.rb on lines 50..121
bin/check-azurerm-cores-ds-usage.rb on lines 50..121
bin/check-azurerm-cores-dsv2-usage.rb on lines 50..121
bin/check-azurerm-cores-dv2-usage.rb on lines 50..121
bin/check-azurerm-cores-f-usage.rb on lines 51..122
bin/check-azurerm-cores-fs-usage.rb on lines 50..121
bin/check-azurerm-load-balancers-usage.rb on lines 50..121
bin/check-azurerm-network-interfaces-usage.rb on lines 50..121
bin/check-azurerm-network-security-groups-usage.rb on lines 50..121
bin/check-azurerm-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-route-tables-usage.rb on lines 50..121
bin/check-azurerm-static-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-virtual-networks-usage.rb on lines 50..121

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 180.

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 15 locations. Consider refactoring.
Open

class CheckAzureRMLoadBalancersUsage < Sensu::Plugin::Check::CLI
  include SensuPluginsAzureRM

  option :tenant_id,
         description: 'ARM Tenant ID. Either set ENV[\'ARM_TENANT_ID\'] or provide it as an option',
Severity: Major
Found in bin/check-azurerm-load-balancers-usage.rb and 14 other locations - About 5 hrs to fix
bin/check-azurerm-core-usage.rb on lines 50..121
bin/check-azurerm-cores-d-usage.rb on lines 50..121
bin/check-azurerm-cores-ds-usage.rb on lines 50..121
bin/check-azurerm-cores-dsv2-usage.rb on lines 50..121
bin/check-azurerm-cores-dv2-usage.rb on lines 50..121
bin/check-azurerm-cores-f-usage.rb on lines 51..122
bin/check-azurerm-cores-fs-usage.rb on lines 50..121
bin/check-azurerm-network-interfaces-usage.rb on lines 50..121
bin/check-azurerm-network-security-groups-usage.rb on lines 50..121
bin/check-azurerm-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-route-tables-usage.rb on lines 50..121
bin/check-azurerm-static-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-virtual-machines-usage.rb on lines 50..121
bin/check-azurerm-virtual-networks-usage.rb on lines 50..121

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 180.

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 15 locations. Consider refactoring.
Open

class CheckAzureRMRouteTablesUsage < Sensu::Plugin::Check::CLI
  include SensuPluginsAzureRM

  option :tenant_id,
         description: 'ARM Tenant ID. Either set ENV[\'ARM_TENANT_ID\'] or provide it as an option',
Severity: Major
Found in bin/check-azurerm-route-tables-usage.rb and 14 other locations - About 5 hrs to fix
bin/check-azurerm-core-usage.rb on lines 50..121
bin/check-azurerm-cores-d-usage.rb on lines 50..121
bin/check-azurerm-cores-ds-usage.rb on lines 50..121
bin/check-azurerm-cores-dsv2-usage.rb on lines 50..121
bin/check-azurerm-cores-dv2-usage.rb on lines 50..121
bin/check-azurerm-cores-f-usage.rb on lines 51..122
bin/check-azurerm-cores-fs-usage.rb on lines 50..121
bin/check-azurerm-load-balancers-usage.rb on lines 50..121
bin/check-azurerm-network-interfaces-usage.rb on lines 50..121
bin/check-azurerm-network-security-groups-usage.rb on lines 50..121
bin/check-azurerm-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-static-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-virtual-machines-usage.rb on lines 50..121
bin/check-azurerm-virtual-networks-usage.rb on lines 50..121

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 180.

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 15 locations. Consider refactoring.
Open

class CheckAzureRMStaticPublicIPAddressesUsage < Sensu::Plugin::Check::CLI
  include SensuPluginsAzureRM

  option :tenant_id,
         description: 'ARM Tenant ID. Either set ENV[\'ARM_TENANT_ID\'] or provide it as an option',
Severity: Major
Found in bin/check-azurerm-static-public-ip-addresses-usage.rb and 14 other locations - About 5 hrs to fix
bin/check-azurerm-core-usage.rb on lines 50..121
bin/check-azurerm-cores-d-usage.rb on lines 50..121
bin/check-azurerm-cores-ds-usage.rb on lines 50..121
bin/check-azurerm-cores-dsv2-usage.rb on lines 50..121
bin/check-azurerm-cores-dv2-usage.rb on lines 50..121
bin/check-azurerm-cores-f-usage.rb on lines 51..122
bin/check-azurerm-cores-fs-usage.rb on lines 50..121
bin/check-azurerm-load-balancers-usage.rb on lines 50..121
bin/check-azurerm-network-interfaces-usage.rb on lines 50..121
bin/check-azurerm-network-security-groups-usage.rb on lines 50..121
bin/check-azurerm-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-route-tables-usage.rb on lines 50..121
bin/check-azurerm-virtual-machines-usage.rb on lines 50..121
bin/check-azurerm-virtual-networks-usage.rb on lines 50..121

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 180.

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 15 locations. Consider refactoring.
Open

class CheckAzureRMCoresDSv2Usage < Sensu::Plugin::Check::CLI
  include SensuPluginsAzureRM

  option :tenant_id,
         description: 'ARM Tenant ID. Either set ENV[\'ARM_TENANT_ID\'] or provide it as an option',
Severity: Major
Found in bin/check-azurerm-cores-dsv2-usage.rb and 14 other locations - About 5 hrs to fix
bin/check-azurerm-core-usage.rb on lines 50..121
bin/check-azurerm-cores-d-usage.rb on lines 50..121
bin/check-azurerm-cores-ds-usage.rb on lines 50..121
bin/check-azurerm-cores-dv2-usage.rb on lines 50..121
bin/check-azurerm-cores-f-usage.rb on lines 51..122
bin/check-azurerm-cores-fs-usage.rb on lines 50..121
bin/check-azurerm-load-balancers-usage.rb on lines 50..121
bin/check-azurerm-network-interfaces-usage.rb on lines 50..121
bin/check-azurerm-network-security-groups-usage.rb on lines 50..121
bin/check-azurerm-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-route-tables-usage.rb on lines 50..121
bin/check-azurerm-static-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-virtual-machines-usage.rb on lines 50..121
bin/check-azurerm-virtual-networks-usage.rb on lines 50..121

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 180.

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 15 locations. Consider refactoring.
Open

class CheckAzureRMCoresFSUsage < Sensu::Plugin::Check::CLI
  include SensuPluginsAzureRM

  option :tenant_id,
         description: 'ARM Tenant ID. Either set ENV[\'ARM_TENANT_ID\'] or provide it as an option',
Severity: Major
Found in bin/check-azurerm-cores-fs-usage.rb and 14 other locations - About 5 hrs to fix
bin/check-azurerm-core-usage.rb on lines 50..121
bin/check-azurerm-cores-d-usage.rb on lines 50..121
bin/check-azurerm-cores-ds-usage.rb on lines 50..121
bin/check-azurerm-cores-dsv2-usage.rb on lines 50..121
bin/check-azurerm-cores-dv2-usage.rb on lines 50..121
bin/check-azurerm-cores-f-usage.rb on lines 51..122
bin/check-azurerm-load-balancers-usage.rb on lines 50..121
bin/check-azurerm-network-interfaces-usage.rb on lines 50..121
bin/check-azurerm-network-security-groups-usage.rb on lines 50..121
bin/check-azurerm-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-route-tables-usage.rb on lines 50..121
bin/check-azurerm-static-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-virtual-machines-usage.rb on lines 50..121
bin/check-azurerm-virtual-networks-usage.rb on lines 50..121

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 180.

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 15 locations. Consider refactoring.
Open

class CheckAzureRMNetworkSecurityGroupsUsage < Sensu::Plugin::Check::CLI
  include SensuPluginsAzureRM

  option :tenant_id,
         description: 'ARM Tenant ID. Either set ENV[\'ARM_TENANT_ID\'] or provide it as an option',
Severity: Major
Found in bin/check-azurerm-network-security-groups-usage.rb and 14 other locations - About 5 hrs to fix
bin/check-azurerm-core-usage.rb on lines 50..121
bin/check-azurerm-cores-d-usage.rb on lines 50..121
bin/check-azurerm-cores-ds-usage.rb on lines 50..121
bin/check-azurerm-cores-dsv2-usage.rb on lines 50..121
bin/check-azurerm-cores-dv2-usage.rb on lines 50..121
bin/check-azurerm-cores-f-usage.rb on lines 51..122
bin/check-azurerm-cores-fs-usage.rb on lines 50..121
bin/check-azurerm-load-balancers-usage.rb on lines 50..121
bin/check-azurerm-network-interfaces-usage.rb on lines 50..121
bin/check-azurerm-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-route-tables-usage.rb on lines 50..121
bin/check-azurerm-static-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-virtual-machines-usage.rb on lines 50..121
bin/check-azurerm-virtual-networks-usage.rb on lines 50..121

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 180.

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 15 locations. Consider refactoring.
Open

class CheckAzureRMCoresFUsage < Sensu::Plugin::Check::CLI
  include SensuPluginsAzureRM

  option :tenant_id,
         description: 'ARM Tenant ID. Either set ENV[\'ARM_TENANT_ID\'] or provide it as an option',
Severity: Major
Found in bin/check-azurerm-cores-f-usage.rb and 14 other locations - About 5 hrs to fix
bin/check-azurerm-core-usage.rb on lines 50..121
bin/check-azurerm-cores-d-usage.rb on lines 50..121
bin/check-azurerm-cores-ds-usage.rb on lines 50..121
bin/check-azurerm-cores-dsv2-usage.rb on lines 50..121
bin/check-azurerm-cores-dv2-usage.rb on lines 50..121
bin/check-azurerm-cores-fs-usage.rb on lines 50..121
bin/check-azurerm-load-balancers-usage.rb on lines 50..121
bin/check-azurerm-network-interfaces-usage.rb on lines 50..121
bin/check-azurerm-network-security-groups-usage.rb on lines 50..121
bin/check-azurerm-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-route-tables-usage.rb on lines 50..121
bin/check-azurerm-static-public-ip-addresses-usage.rb on lines 50..121
bin/check-azurerm-virtual-machines-usage.rb on lines 50..121
bin/check-azurerm-virtual-networks-usage.rb on lines 50..121

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 180.

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

    def build_usage_operation_client(tenant_id, client_id, secret, subscription_id)
      token_provider = MsRestAzure::ApplicationTokenProvider.new(tenant_id, client_id, secret)
      credentials = MsRest::TokenCredentials.new(token_provider)
      client = Azure::ARM::Compute::ComputeManagementClient.new(credentials)
      client.subscription_id = subscription_id
Severity: Minor
Found in lib/sensu-plugins-azurerm/compute_usage.rb and 2 other locations - About 30 mins to fix
lib/sensu-plugins-azurerm/network_usage.rb on lines 5..12
lib/sensu-plugins-azurerm/network_usage.rb on lines 15..22

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

    def build_usage_client(tenant_id, client_id, secret, subscription_id)
      token_provider = MsRestAzure::ApplicationTokenProvider.new(tenant_id, client_id, secret)
      credentials = MsRest::TokenCredentials.new(token_provider)
      client = Azure::ARM::Network::NetworkManagementClient.new(credentials)
      client.subscription_id = subscription_id
Severity: Minor
Found in lib/sensu-plugins-azurerm/network_usage.rb and 2 other locations - About 30 mins to fix
lib/sensu-plugins-azurerm/compute_usage.rb on lines 5..12
lib/sensu-plugins-azurerm/network_usage.rb on lines 15..22

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

    def build_virtual_network_gateways_client(tenant_id, client_id, secret, subscription_id)
      token_provider = MsRestAzure::ApplicationTokenProvider.new(tenant_id, client_id, secret)
      credentials = MsRest::TokenCredentials.new(token_provider)
      client = Azure::ARM::Network::NetworkManagementClient.new(credentials)
      client.subscription_id = subscription_id
Severity: Minor
Found in lib/sensu-plugins-azurerm/network_usage.rb and 2 other locations - About 30 mins to fix
lib/sensu-plugins-azurerm/compute_usage.rb on lines 5..12
lib/sensu-plugins-azurerm/network_usage.rb on lines 5..12

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

Severity
Category
Status
Source
Language