dtan4/terraforming

View on GitHub

Showing 25 of 37 total issues

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

      def tfstate
        hosted_zones.inject({}) do |resources, hosted_zone|
          zone_id = zone_id_of(hosted_zone)
          vpc = vpc_of(hosted_zone)

Severity: Minor
Found in lib/terraforming/resource/route53_zone.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 tfstate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def tfstate
        auto_scaling_groups.inject({}) do |resources, group|
          vpc_zone_specified = vpc_zone_specified?(group)

          attributes = {
Severity: Minor
Found in lib/terraforming/resource/auto_scaling_group.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 tfstate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def tfstate
        queues.inject({}) do |resources, queue|
          attributes = {
            "name"                       => module_name_of(queue),
            "id"                         => queue["QueueUrl"],
Severity: Minor
Found in lib/terraforming/resource/sqs.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 security_groups_in has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def security_groups_in(permission, security_group)
        permission.user_id_group_pairs.map do |range|
          # EC2-Classic, same account
          if security_group.owner_id == range.user_id && !range.group_name.nil?
            range.group_name
Severity: Minor
Found in lib/terraforming/resource/security_group.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 tfstate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def tfstate
        launch_configurations.inject({}) do |resources, lc|
          attributes = {
            "name" => lc.launch_configuration_name,
            "image_id" => lc.image_id,
Severity: Minor
Found in lib/terraforming/resource/launch_configuration.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