vdelacou/iblis-ui

View on GitHub

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
Severity: Minor
Found in src/components/ui_components/filter_button/index.tsx - About 2 hrs to fix

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, //
Severity: Major
Found in src/components/form_components/user_profile_form/index.tsx - About 1 hr to fix

    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 = () => {
    Severity: Minor
    Found in src/components/ui_components/progress_bar/index.tsx - About 1 hr to fix

    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) {
    Severity: Major
    Found in src/components/form_components/change_password_form/index.tsx - About 1 hr to fix

      Function ManagedSimpleFormBase has 101 lines of code (exceeds 100 allowed). Consider refactoring.
      Open

      const ManagedSimpleFormBase: React.StatelessComponent<ManagedSimpleFormProps> = (props) => {
      
          const {
              data,
              idFieldName, displayFieldName,
      Severity: Major
      Found in src/components/form_components/managed_simple_form/index.tsx - About 1 hr to fix

        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) {
        Severity: Minor
        Found in src/components/form_components/force_change_password_form/index.tsx - About 45 mins to fix

          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
          Severity: Minor
          Found in src/components/ui_components/account_card/index.tsx - About 35 mins to fix

          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>) => {
          Severity: Minor
          Found in src/components/ui_components/upload_avatar/index.tsx - About 35 mins to fix

          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;
          Severity: Minor
          Found in src/layouts/card_menu/index.tsx - About 35 mins to fix

          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 }
          Severity: Minor
          Found in src/components/form_components/managed_simple_list_form/index.tsx - About 35 mins to fix

          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

          Severity
          Category
          Status
          Source
          Language