Showing 10 of 75 total issues
File DashboardPage.tsx
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
CalendarOutlined,
CarryOutOutlined,
CheckOutlined,
CloseOutlined,
Function LoginPage
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const LoginPage = ({ loggedIn, setLoggedIn }: LoginPageProps): JSX.Element => {
const history = useHistory();
const location = useLocation<LocationState>();
const [beforeLoginPath, setBeforeLoginPath] = useState("/");
- 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 resolve_assign_mates
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def resolve_assign_mates(
obj: Any, info: GraphQLResolveInfo, mateAssignments: List[MateAssignmentInput]
) -> List[str]:
"""
Assign mates to specified families.
- 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 get_google_person_list
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_google_person_list(
token: str,
http: Optional[httplib2.Http] = None,
http2: Optional[httplib2.Http] = None,
) -> Tuple[Optional[AppError], Optional[List[GooglePerson]]]:
- 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 resolve_add_new_mates
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def resolve_add_new_mates(
obj: Any, info: GraphQLResolveInfo, mates: List[NewMatesInput]
) -> List[Mate]:
"""Add new mates to the user's unassigned family."""
user = User.lookup_user(current_user.get_id())
- 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 add_google_user
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def add_google_user(token: str) -> Tuple[Optional[AppError], Optional[User]]:
"""
Add or update new google user.
If user with same google id exists, update the store access token.
- 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
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def run() -> None:
"""Get all users without family_ids and populate with a starter families."""
users = User.objects(family_ids__exists=False)
for user in users:
family_ids: List[ObjectId] = [user.unassigned_family_id]
- 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 (None, newUser)
Function AssignMatesPage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const AssignMatesPage = (): JSX.Element => {
const [groups, setGroups] = useState<Record<string, UnassignedMate[]>>({});
const [familyMap, setFamilyMap] = useState<Record<string, Family>>({});
const [unassignedFamilyId, setUnassignedFamilyId] = useState("");
const [isAllAssigned, setIsAllAssigned] = useState(false);
- 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 SyncCard
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const SyncCard = ({
sync,
removeSync,
editSync,
style,
- 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"