yourkarma/JWT

View on GitHub
Scripts/generate_ec_curved_keys.rb

Summary

Maintainability
C
1 day
Test Coverage

Class KeysGenerator has 30 methods (exceeds 20 allowed). Consider refactoring.
Open

class KeysGenerator
    module FileFormatsModule
        def only_name(name)
            # remove extension
            Pathname.new(name).basename
Severity: Minor
Found in Scripts/generate_ec_curved_keys.rb - About 3 hrs to fix

    File generate_ec_curved_keys.rb has 287 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'optparse'
    require 'shellwords'
    require 'pathname'
    class ShellExecutor
        @@dry_run = false
    Severity: Minor
    Found in Scripts/generate_ec_curved_keys.rb - About 2 hrs to fix

      Method generated has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def generated(type, parameters, private_key_pem, public_key_pem, certificate_request, certificate, p12, p12_password)
      Severity: Major
      Found in Scripts/generate_ec_curved_keys.rb - About 1 hr to fix

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

            def generated(type, parameters, private_key_pem, public_key_pem, certificate_request, certificate, p12, p12_password)
                the_private_key_pem ||= FileFormats.to_pem private_key_pem
                the_public_key_pem ||= FileFormats.to_pem public_key_pem
                the_certificate_request ||= FileFormats.to_certificate_request certificate_request
                the_certificate ||= FileFormats.to_certificate certificate
        Severity: Minor
        Found in Scripts/generate_ec_curved_keys.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

        There are no issues that match your filters.

        Category
        Status