Showing 22 of 87 total issues
Function testExperienceMain
has 188 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function testExperienceMain(div: HTMLDivElement, locale: Locale) {
type Fixture = {
company: string,
title: string,
location: string,
File ExperienceMain.tsx
has 385 lines of code (exceeds 250 allowed). Consider refactoring. Open
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'
Function testPortfolioMain
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function testPortfolioMain(div: HTMLDivElement) {
const fixture = new Map<string, PortfolioMainFixture>([
['Markets', {
url: 'https://markets.bitcoin.com/',
title: 'business-card-portfolio-markets-title',
Function testFooterInfo
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
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')
- 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
File TestUtils.ts
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
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) {
Function AboutMain
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function AboutMain() {
const { t, i18n } = useTranslation()
const totalExperience = new TotalExperience()
return (
<Container id="about">
Function testFooterInfo
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
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')
Function MenuMain
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function MenuMain() {
const { t } = useTranslation()
const [expanded, setExpanded] = React.useState<boolean>(false)
const [activeNavLink, setActiveNavLink] = React.useState<string>(document.location.hash)
Function testSkills
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function testSkills(div: HTMLDivElement) {
const expectedSkillsMap = new Map<string, string>([
['aws', 'AWS'],
['bootstrap', 'Bootstrap'],
['concourseCI', 'Concourse CI'],
Function testCertificatesMain
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function testAboutMain
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function testAboutMain(div: HTMLDivElement) {
expect(div).toHaveClass('container')
testSectionTitle(
div.querySelector('div.section-title'),
'business-card-about-me-title'
Function testMenuMain
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function testMenuMain(div: HTMLDivElement) {
const expected = [
'about',
'skills',
'experience',
Function testLanguageMain
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function testLanguageMain(div: HTMLDivElement) {
expect(div).toHaveClass('light-component')
testSectionTitle(
div.querySelector('div.section-title'),
'business-card-languages-title'
Function testEducationMain
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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')
Function testCertificateItem
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
div: HTMLDivElement,
locale: Locale,
date: Date,
issuerName: string,
technology: string,
Function testDateDuration
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
div: HTMLDivElement,
code: string,
fromMonthIndex: number,
fromYear: number,
toMonthIndex?: number,
Function testJobPeriod
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
div: HTMLDivElement,
locale: Locale,
fromMonthIndex: number,
fromYear: number,
toMonthIndex?: number,
Function testDateTimeline
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
div: HTMLDivElement,
locale: Locale,
fromMonthIndex: number,
fromYear: number,
toMonthIndex?: number,
Function testPortfolioItem
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
div: HTMLDivElement,
url: string,
name: string,
title: string,
subtitle: string,
Function testEducationItem
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
container: HTMLElement,
from: number,
to: number,
title: string,
testHeading: TestHeadingFunction = (h4: HTMLHeadingElement) =>