fabasoad/business-card

View on GitHub

Showing 22 of 87 total issues

Function testExperienceMain has 188 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function testExperienceMain(div: HTMLDivElement, locale: Locale) {
  type Fixture = {
    company: string,
    title: string,
    location: string,
Severity: Major
Found in src/__tests__/components/Experience/TestUtils.ts - About 7 hrs to fix

    File ExperienceMain.tsx has 385 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import * as React from 'react'
    import * as imgArkaFSS from '../../assets/images/companies/arka-fss.png'
    import * as imgBitcoinCom from '../../assets/images/companies/bitcoin-com.png'
    import * as imgLohika from '../../assets/images/companies/lohika.png'
    import * as imgWbyT from '../../assets/images/companies/wbyt.png'
    Severity: Minor
    Found in src/components/Experience/ExperienceMain.tsx - About 5 hrs to fix

      Function testPortfolioMain has 110 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function testPortfolioMain(div: HTMLDivElement) {
        const fixture = new Map<string, PortfolioMainFixture>([
          ['Markets', {
            url: 'https://markets.bitcoin.com/',
            title: 'business-card-portfolio-markets-title',
      Severity: Major
      Found in src/__tests__/components/Portfolio/TestUtils.ts - About 4 hrs to fix

        Function testFooterInfo has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

        export function testFooterInfo(div: HTMLDivElement): void {
          expect(div).toHaveClass('footer-info')
          const ul = div.querySelector('ul')
          expect(ul).toHaveAttribute('class', 'icon-list')
          const liElements = ul.querySelectorAll('li')
        Severity: Minor
        Found in src/__tests__/components/Footer/TestUtils.ts - About 3 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

        File TestUtils.ts has 265 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import TechnologyStorage from '../../../scripts/technologies/TechnologyStorage'
        import { Locale } from '../../../scripts/i18n/types'
        import { testDateDuration, testDateTimeline, testSectionTitle } from '../Controls/TestUtils'
        
        export function testExperienceMain(div: HTMLDivElement, locale: Locale) {
        Severity: Minor
        Found in src/__tests__/components/Experience/TestUtils.ts - About 2 hrs to fix

          Function AboutMain has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function AboutMain() {
            const { t, i18n } = useTranslation()
            const totalExperience = new TotalExperience()
            return (
              <Container id="about">
          Severity: Major
          Found in src/components/About/AboutMain.tsx - About 2 hrs to fix

            Function testFooterInfo has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function testFooterInfo(div: HTMLDivElement): void {
              expect(div).toHaveClass('footer-info')
              const ul = div.querySelector('ul')
              expect(ul).toHaveAttribute('class', 'icon-list')
              const liElements = ul.querySelectorAll('li')
            Severity: Minor
            Found in src/__tests__/components/Footer/TestUtils.ts - About 1 hr to fix

              Function MenuMain has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function MenuMain() {
                const { t } = useTranslation()
              
                const [expanded, setExpanded] = React.useState<boolean>(false)
                const [activeNavLink, setActiveNavLink] = React.useState<string>(document.location.hash)
              Severity: Minor
              Found in src/components/Menu/MenuMain.tsx - About 1 hr to fix

                Function testSkills has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function testSkills(div: HTMLDivElement) {
                  const expectedSkillsMap = new Map<string, string>([
                    ['aws', 'AWS'],
                    ['bootstrap', 'Bootstrap'],
                    ['concourseCI', 'Concourse CI'],
                Severity: Minor
                Found in src/__tests__/components/TestUtils.ts - About 1 hr to fix

                  Function testCertificatesMain has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function testCertificatesMain(div: HTMLDivElement, locale: Locale) {
                    function findByUrl(items: Array<any>, url: string): any {
                      for (const item of items) {
                        if (item.url === url) {
                          return item
                  Severity: Minor
                  Found in src/__tests__/components/Certificates/TestUtils.ts - About 1 hr to fix

                    Function testAboutMain has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function testAboutMain(div: HTMLDivElement) {
                      expect(div).toHaveClass('container')
                      testSectionTitle(
                        div.querySelector('div.section-title'),
                        'business-card-about-me-title'
                    Severity: Minor
                    Found in src/__tests__/components/About/TestUtils.ts - About 1 hr to fix

                      Function testMenuMain has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function testMenuMain(div: HTMLDivElement) {
                        const expected = [
                          'about',
                          'skills',
                          'experience',
                      Severity: Minor
                      Found in src/__tests__/components/Menu/TestUtils.ts - About 1 hr to fix

                        Function testLanguageMain has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function testLanguageMain(div: HTMLDivElement) {
                          expect(div).toHaveClass('light-component')
                          testSectionTitle(
                            div.querySelector('div.section-title'),
                            'business-card-languages-title'
                        Severity: Minor
                        Found in src/__tests__/components/Languages/TestUtils.ts - About 1 hr to fix

                          Function testEducationMain has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function testEducationMain(div: HTMLDivElement, locale: Locale) {
                            const from = 2005
                            const to = 2010
                            expect(div).toHaveClass('light-component')
                            const divContainer = div.querySelector('div.container')
                          Severity: Minor
                          Found in src/__tests__/components/Education/TestUtils.ts - About 1 hr to fix

                            Function testCertificateItem has 7 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              div: HTMLDivElement,
                              locale: Locale,
                              date: Date,
                              issuerName: string,
                              technology: string,
                            Severity: Major
                            Found in src/__tests__/components/Certificates/TestUtils.ts - About 50 mins to fix

                              Function testDateDuration has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                div: HTMLDivElement,
                                code: string,
                                fromMonthIndex: number,
                                fromYear: number,
                                toMonthIndex?: number,
                              Severity: Minor
                              Found in src/__tests__/components/Controls/TestUtils.ts - About 45 mins to fix

                                Function testJobPeriod has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                  div: HTMLDivElement,
                                  locale: Locale,
                                  fromMonthIndex: number,
                                  fromYear: number,
                                  toMonthIndex?: number,
                                Severity: Minor
                                Found in src/__tests__/components/Experience/TestUtils.ts - About 45 mins to fix

                                  Function testDateTimeline has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                    div: HTMLDivElement,
                                    locale: Locale,
                                    fromMonthIndex: number,
                                    fromYear: number,
                                    toMonthIndex?: number,
                                  Severity: Minor
                                  Found in src/__tests__/components/Controls/TestUtils.ts - About 45 mins to fix

                                    Function testPortfolioItem has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                      div: HTMLDivElement,
                                      url: string,
                                      name: string,
                                      title: string,
                                      subtitle: string,
                                    Severity: Minor
                                    Found in src/__tests__/components/Portfolio/TestUtils.ts - About 45 mins to fix

                                      Function testEducationItem has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                        container: HTMLElement,
                                        from: number,
                                        to: number,
                                        title: string,
                                        testHeading: TestHeadingFunction = (h4: HTMLHeadingElement) =>
                                      Severity: Minor
                                      Found in src/__tests__/components/Education/TestUtils.ts - About 35 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language