fabasoad/business-card

View on GitHub

Showing 83 of 87 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

describe('DateTimeline', () => {
  const locale: Locale = SupportedLocales.default

  test('should render DateTimeline correctly with from and to', () => {
    const fromMonthIndex = 6
Severity: Major
Found in src/__tests__/components/Controls/DateTimeline.spec.tsx and 1 other location - About 1 day to fix
src/__tests__/components/Experience/JobPeriod.spec.tsx on lines 9..51

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 224.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

describe('JobPeriod', () => {
  const locale: Locale = SupportedLocales.default

  test('should render JobPeriod correctly with from and to', () => {
    const fromMonthIndex = 1
Severity: Major
Found in src/__tests__/components/Experience/JobPeriod.spec.tsx and 1 other location - About 1 day to fix
src/__tests__/components/Controls/DateTimeline.spec.tsx on lines 9..51

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 224.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

              <li>
                <JobPeriod
                  fromMonthIndex={8}
                  fromYear={2018}
                  toMonthIndex={5}
    Severity: Major
    Found in src/components/Experience/ExperienceMain.tsx and 1 other location - About 7 hrs to fix
    src/components/Experience/ExperienceMain.tsx on lines 78..106

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 185.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

              <li className="timeline-inverted">
                <JobPeriod
                  fromMonthIndex={9}
                  fromYear={2021}
                  toMonthIndex={5}
    Severity: Major
    Found in src/components/Experience/ExperienceMain.tsx and 1 other location - About 7 hrs to fix
    src/components/Experience/ExperienceMain.tsx on lines 223..255

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 185.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        export function testFooterEmail(div: HTMLDivElement): void {
          expect(div).toHaveAttribute('class', 'col')
          const i = div.querySelector('i')
          for (const c of ['fa', 'fa-envelope', 'fa-2x']) {
            expect(i).toHaveClass(c)
        Severity: Major
        Found in src/__tests__/components/Footer/TestUtils.ts and 1 other location - About 3 hrs to fix
        src/__tests__/components/Footer/TestUtils.ts on lines 68..75

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 108.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        export function testFooterLocation(div: HTMLDivElement): void {
          expect(div).toHaveAttribute('class', 'col')
          const i = div.querySelector('i')
          for (const c of ['fa', 'fa-map-marker-alt', 'fa-2x']) {
            expect(i).toHaveClass(c)
        Severity: Major
        Found in src/__tests__/components/Footer/TestUtils.ts and 1 other location - About 3 hrs to fix
        src/__tests__/components/Footer/TestUtils.ts on lines 9..16

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 108.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        export default function StatsStackOverflow({ reputation = 1783, answerCount = 0 }: StackExchangeData) {
          return (
            <StatsStackExchange
              data={{ reputation, answerCount }}
              service={new StackOverflowService({ reputation, answerCount })}
        Severity: Major
        Found in src/components/Stats/StatsStackOverflow.tsx and 1 other location - About 3 hrs to fix
        src/components/Stats/StatsSuperUser.tsx on lines 6..16

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 100.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        export default function StatsSuperUser({ reputation = 101, answerCount = 0 }: StackExchangeData) {
          return (
            <StatsStackExchange
              data={{ reputation, answerCount }}
              service={new SuperUserService({ reputation, answerCount })}
        Severity: Major
        Found in src/components/Stats/StatsSuperUser.tsx and 1 other location - About 3 hrs to fix
        src/components/Stats/StatsStackOverflow.tsx on lines 6..16

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 100.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        test('should render StatsLeetcode correctly', async () => {
          const expectedTotalSolved: number = randomNumber(1, 100)
          const { container} = await act(async () => render(
            <StatsLeetcode totalSolved={expectedTotalSolved} />
          ))
        Severity: Major
        Found in src/__tests__/components/Stats/StatsLeetcode.spec.tsx and 2 other locations - About 3 hrs to fix
        src/__tests__/components/Stats/StatsStackOverflow.spec.tsx on lines 10..21
        src/__tests__/components/Stats/StatsSuperUser.spec.tsx on lines 10..21

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 95.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        test('should render StatsSuperUser correctly', async () => {
          const expectedReputation: number = randomNumber(1, 100)
          const { container } = await act(async () => render(
            <StatsSuperUser reputation={expectedReputation} />
          ))
        Severity: Major
        Found in src/__tests__/components/Stats/StatsSuperUser.spec.tsx and 2 other locations - About 3 hrs to fix
        src/__tests__/components/Stats/StatsLeetcode.spec.tsx on lines 10..21
        src/__tests__/components/Stats/StatsStackOverflow.spec.tsx on lines 10..21

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 95.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        test('should render StatsStackOverflow correctly', async () => {
          const expectedReputation: number = randomNumber(1, 100)
          const { container } = await act(async () => render(
            <StatsStackOverflow reputation={expectedReputation} />
          ))
        Severity: Major
        Found in src/__tests__/components/Stats/StatsStackOverflow.spec.tsx and 2 other locations - About 3 hrs to fix
        src/__tests__/components/Stats/StatsLeetcode.spec.tsx on lines 10..21
        src/__tests__/components/Stats/StatsSuperUser.spec.tsx on lines 10..21

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 95.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            createRoot(document.getElementById('app')!).render(
              <React.Suspense fallback={<LoadingSpinner />}>
                <AppWrapper>
                  <App />
                </AppWrapper>
            Severity: Major
            Found in src/app.tsx and 1 other location - About 2 hrs to fix
            src/app404.tsx on lines 8..14

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 78.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            createRoot(document.getElementById('app')!).render(
              <React.Suspense fallback={<LoadingSpinner />}>
                <AppWrapper>
                  <App404 />
                </AppWrapper>
            Severity: Major
            Found in src/app404.tsx and 1 other location - About 2 hrs to fix
            src/app.tsx on lines 9..15

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 78.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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
              Severity
              Category
              Status
              Source
              Language