cassandra_snap/main.py
File main.py
has 293 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from __future__ import (absolute_import, print_function)
# From system
from collections import defaultdict
from fabric.api import env
Function main
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def main():
base_parser = add_s3_arguments(_base_parser)
subparsers = base_parser.add_subparsers(
title='subcommands', dest='subcommand'
)
Function restore_backup
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
def restore_backup(args):
snapshots = SnapshotCollection(
args.aws_access_key_id,
args.aws_secret_access_key,
args.s3_base_path,
- Read upRead up
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 run_backup
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def run_backup(args):
if args.user:
env.user = args.user
if args.password:
- Read upRead up
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
Line too long (84 > 79 characters) Open
Open
help="The file containing the private ssh key to use to connect with hosts")
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (98 > 79 characters) Open
Open
help="Limit the upload speed to S3 (by using 'pv'). Value expressed in kilobytes (*1024)")
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (80 > 79 characters) Open
Open
help="Comma separated list of keyspaces to backup (omit to backup all)")
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.