18F/federalist-garden-build

View on GitHub
src/publishing/s3publisher.py

Summary

Maintainability
A
0 mins
Test Coverage
A
92%

Function publish_to_s3 has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Wontfix

def publish_to_s3(directory, base_url, site_prefix, bucket, federalist_config,
                  s3_client, dry_run=False):
    '''Publishes the given directory to S3'''
    logger = get_logger('publish')

Severity: Minor
Found in src/publishing/s3publisher.py - About 3 hrs 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

Function list_remote_objects has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Wontfix

def list_remote_objects(bucket, site_prefix, s3_client):
    '''

    Generates a list of remote S3 objects that have keys starting with
    site_prefix in the given bucket.
Severity: Minor
Found in src/publishing/s3publisher.py - 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

Function publish_to_s3 has 7 arguments (exceeds 4 allowed). Consider refactoring.
Wontfix

def publish_to_s3(directory, base_url, site_prefix, bucket, federalist_config,
Severity: Major
Found in src/publishing/s3publisher.py - About 50 mins to fix

    There are no issues that match your filters.

    Category
    Status