Showing 15 of 33 total issues
Function text
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def text(length=None, at_least=10, at_most=15, lowercase=True,
uppercase=True, digits=True, spaces=True, punctuation=False):
"""
Return random text.
- 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 text
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def text(what="sentence", *args, **kwargs):
"""An aggregator for all above defined public methods."""
if what == "character":
return character(*args, **kwargs)
- 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 text
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def text(length=None, at_least=10, at_most=15, lowercase=True,
Function password
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def password(at_least=6, at_most=12, lowercase=True,
Function paragraphs
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def paragraphs(quantity=2, separator='\n\n', wrap_start='', wrap_end='',
Function body
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def body(quantity=2, separator='\n\n', wrap_start='', wrap_end='',
Function check_digit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def check_digit(num):
"""Return a check digit of the given credit card number.
Check digit calculated using Luhn algorithm ("modulus 10")
See: http://www.darkcoding.net/credit-card/luhn-formula/
- 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 paragraph
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def paragraph(separator='\n\n', wrap_start='', wrap_end='',
Function paragraphs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def paragraphs(quantity=2, separator='\n\n', wrap_start='', wrap_end='',
html=False, sentences_quantity=3, as_list=False):
"""Return random paragraphs."""
if html:
wrap_start = '<p>'
- 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
Avoid too many return
statements within this function. Open
return sentence(*args, **kwargs)
Avoid too many return
statements within this function. Open
return paragraphs(*args, **kwargs)
Avoid too many return
statements within this function. Open
return sentences(*args, **kwargs)
Avoid too many return
statements within this function. Open
return paragraph(*args, **kwargs)
Avoid too many return
statements within this function. Open
return title(*args, **kwargs)
Function number
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def number(type=None, length=None, prefixes=None):
"""
Return a random credit card number.
:param type: credit card type. Defaults to a random selection.
- 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"