File _wbtypes.py
has 947 lines of code (exceeds 900 allowed). Consider refactoring. Open
"""Wikibase data type classes."""
#
# (C) Pywikibot team, 2013-2024
#
# Distributed under the terms of the MIT license.
Function __init__
has a Cognitive Complexity of 23 (exceeds 10 allowed). Consider refactoring. Open
def __init__(self,
year: int | None = None,
month: int | None = None,
day: int | None = None,
hour: int | None = None,
- 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 __init__
has 12 arguments (exceeds 7 allowed). Consider refactoring. Open
def __init__(self,
Function normalize
has a Cognitive Complexity of 15 (exceeds 10 allowed). Consider refactoring. Open
def normalize(self) -> WbTime:
"""Normalizes the WbTime object to account for precision.
Normalization is needed because WbTime objects can have hidden
values that affect naive comparisons, such as an object set to
- 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 __init__
has 11 arguments (exceeds 7 allowed). Consider refactoring. Open
def __init__(self, lat: float, lon: float, alt: float | None = None,
Function fromTimestamp
has 8 arguments (exceeds 7 allowed). Consider refactoring. Open
def fromTimestamp(cls,
Function _getSecondsAdjusted
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def _getSecondsAdjusted(self) -> int:
"""Return an internal representation of the time object as seconds.
The value adjusts itself for timezones. It is not compatible
with before/after.
- 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
TODO found Open
radius = 6378137 # TODO: Support other globes
- Exclude checks
TODO found Open
# TODO: This method signature does not match our parent class (which
- Exclude checks
FIXME found Open
FIXME: Should this be in the DataSite object?
- Exclude checks