Showing 10 of 136 total issues
Function renderButtonFilter
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
const renderButtonFilter = (menuItem: FilterButtonMenuProps[], activeFilter: number, theme: Theme) => {
return menuItem.map((
item: FilterButtonMenuProps,
index: number) => {
// the first button
- 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 UserProfileFormBase
has 118 lines of code (exceeds 100 allowed). Consider refactoring. Open
const UserProfileFormBase: React.StatelessComponent<UserProfileFormProps & InjectedFormProps<UserProfileFormValues, UserProfileFormProps>> = (props) => {
const {
initValues, //
firstNameLabel, lastNameLabel, emailLabel, languageLabel, //
Function ProgressBarBase
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const ProgressBarBase: React.StatelessComponent<ProgressBarProps & WithTheme> = (props) => {
const { menuList, activeIndex, isLoading = false, action, theme } = props;
const renderMenu = () => {
- 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 renderFormField
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
type: string, fieldName: string, label: string, submitting: boolean, needHelpPassword: boolean, passwordExplainLabel: string, theme: Theme,
validateFunction: Array<(value: string, allValues: ChangePasswordFormValues, props: ChangePasswordFormProps) => string | undefined>, isLoading?: boolean) {
Function ManagedSimpleFormBase
has 101 lines of code (exceeds 100 allowed). Consider refactoring. Open
const ManagedSimpleFormBase: React.StatelessComponent<ManagedSimpleFormProps> = (props) => {
const {
data,
idFieldName, displayFieldName,
Function renderFormField
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
type: string, fieldName: string, label: string, submitting: boolean,
validateFunction: Array<(value: string, allValues: ForceChangePasswordFormValues, props: ForceChangePasswordFormProps) => string | undefined>, isLoading?: boolean) {
Function AccountCardBase
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const AccountCardBase: React.StatelessComponent<AccountCardProps & WithTheme> = (props) => {
const { firstName, lastName, email, buttonText, buttonAction, avatarUrl, theme } = props;
// if no name we display email
- 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 UploadAvatarBase
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const UploadAvatarBase: React.StatelessComponent<UploadAvatarProps & WithTheme> = (props) => {
const { buttonLabel, avatarUrl, captionLabel, fileType, fileSize, onClick, handleTypeError, handleSizeError, theme } = props;
const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
- 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 CardMenuBase
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const CardMenuBase: React.StatelessComponent<CardMenuProps & WithStyles<ClassKey> & WithTheme & WithWidth & { children?: React.ReactNode }> = (props) => {
const { menu, firstLevelActive, secondLevelActive, theme, classes, width, children } = props;
// we fallback to zero if try to activate unknown menu
const firstLevelIndex = menu.length > firstLevelActive ? firstLevelActive : 0;
- 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 render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
render(): React.ReactNode {
const {
editLabel = 'Edit', deleteLabel = 'Delete', confirmDeleteLabel = 'Do you confirm you want to delete this?', leftComponent, componentHeight = 60,
isLoading = false, menuAction = [], hasEdit = true, hasDelete = true, theme }
- 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"