Function handle
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def handle(self, *args, **kwargs):
# disconnect signal handler for on-demand indexing, for efficiency
# (index in bulk after an update, not one at a time)
IndexableSignalHandler.disconnect()
- Read upRead up
- Create a ticketCreate a ticket
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 import_digitizedwork
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def import_digitizedwork(self, htid):
"""Import a single work into the database.
Retrieves bibliographic data from Hathi api. If the record already
exists in the database, it is only updated if the hathi record
has changed or if an update is requested by the user.
- Read upRead up
- Create a ticketCreate a ticket
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 initialize_pairtrees
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize_pairtrees(self):
"""Initialize pairtree storage clients for each
subdirectory in the configured **HATHI_DATA** path."""
# if the configured directory does not exist or is not
- Read upRead up
- Create a ticketCreate a ticket
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"