cchandler/certificate_authority

View on GitHub
lib/certificate_authority/extensions.rb

Summary

Maintainability
C
1 day
Test Coverage

File extensions.rb has 469 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module CertificateAuthority
  module Extensions
    module ExtensionAPI
      def to_s
        raise "Implementation required"
Severity: Minor
Found in lib/certificate_authority/extensions.rb - About 7 hrs to fix

    Method config_extensions has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

          def config_extensions
            config_extension = {}
            custom_policies = {}
            notice = {}
            unless self.policy_identifier.nil?
    Severity: Minor
    Found in lib/certificate_authority/extensions.rb - About 1 hr 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 config_extensions has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def config_extensions
            config_extension = {}
            custom_policies = {}
            notice = {}
            unless self.policy_identifier.nil?
    Severity: Minor
    Found in lib/certificate_authority/extensions.rb - About 1 hr to fix

      Method parse has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

            def self.parse(value, critical)
              obj = self.new
              return obj if value.nil?
              obj.critical = critical
              value.split(/,\s*/).each do |v|
      Severity: Minor
      Found in lib/certificate_authority/extensions.rb - About 55 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

      There are no issues that match your filters.

      Category
      Status