hooktstudios/capistrano-s3

View on GitHub

Showing 7 of 7 total issues

Method publish! has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

        def publish!(region, key, secret, bucket, deployment_path, target_path, distribution_id,
                     invalidations, exclusions, only_gzip, extra_options, stage = "default")
          deployment_path_absolute = File.expand_path(deployment_path, Dir.pwd)
          s3_client = establish_s3_client_connection!(region, key, secret)

Severity: Minor
Found in lib/capistrano/s3/publisher.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 publish! has 12 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def publish!(region, key, secret, bucket, deployment_path, target_path, distribution_id,
                     invalidations, exclusions, only_gzip, extra_options, stage = "default")
Severity: Major
Found in lib/capistrano/s3/publisher.rb - About 1 hr to fix

    Method publish! has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            def publish!(region, key, secret, bucket, deployment_path, target_path, distribution_id,
                         invalidations, exclusions, only_gzip, extra_options, stage = "default")
              deployment_path_absolute = File.expand_path(deployment_path, Dir.pwd)
              s3_client = establish_s3_client_connection!(region, key, secret)
    
    
    Severity: Minor
    Found in lib/capistrano/s3/publisher.rb - About 1 hr to fix

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

              def put_object(s3_client, bucket, target_path, path, file, only_gzip, extra_options)
                prefer_cf_mime_types = extra_options[:prefer_cf_mime_types] || false
      
                base_name = File.basename(file)
                mime_type = mime_type_for_file(base_name, prefer_cf_mime_types)
      Severity: Minor
      Found in lib/capistrano/s3/publisher.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

      Method put_object has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              def put_object(s3_client, bucket, target_path, path, file, only_gzip, extra_options)
      Severity: Major
      Found in lib/capistrano/s3/publisher.rb - About 50 mins to fix

        Method check_invalidation has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                def check_invalidation(region, key, secret, distribution_id, _stage = "default")
        Severity: Minor
        Found in lib/capistrano/s3/publisher.rb - About 35 mins to fix

          Method clear! has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  def clear!(region, key, secret, bucket, stage = "default")
          Severity: Minor
          Found in lib/capistrano/s3/publisher.rb - About 35 mins to fix
            Severity
            Category
            Status
            Source
            Language