Showing 45 of 133 total issues
Function Diagnoses
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Diagnoses: NextPage = () => {
const { t } = useTranslation();
const router = useRouter();
if (typeof router.query.diagnosis_id !== 'string') {
Function Wizard
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Wizard = () => {
const { t } = useTranslation();
const [value, setValue] = useState('');
const router = useRouter();
File code-frame.tsx
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import classNames from 'classnames';
import { parsePatch } from 'diff';
import React, { useMemo } from 'react';
import { useTranslation } from '../../../utils/i18next';
Function findCSS
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async findCSS(
xpath: string,
propertyName: string,
): Promise<[string, postcss.Node] | undefined> {
// 1. find matching css from the depot using CDP
Function Banner
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Banner = () => {
const { t, i18n } = useTranslation();
const navItems: NavItem[] = [
{
Function create
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async create(ctx: Context): Promise<void> {
const elms = await ctx.session.runScript<DTO[]>(`
visible
.$$('*')
.filter((elm) => elm.textContent !== '')
Function Index
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Index: NextPage = () => {
const { t } = useTranslation();
const title = t('home.title', 'Is your website visible?');
const description = t(
Function create
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async create(ctx: Context): Promise<void> {
const xpaths = await ctx.session.runScript<string[]>(`
visible
.$$('img')
.map((elm) => visible.createXPath(elm));
Function Switch
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Switch = (props: SwitchProps) => {
const { value, disabled, children } = props;
const [checked, setChecked] = useState(value);
const handleCheck = () => {
Function Sponsor
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Sponsor = () => {
const { t } = useTranslation();
return (
<div className="flex flex-col items-center w-full space-y-8">
Function print
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const print = async (
sources: Source[],
json: boolean,
fix: boolean,
): Promise<void> => {
Function print
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
export const print = async (
sources: Source[],
json: boolean,
fix: boolean,
): Promise<void> => {
- 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 create
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async create(ctx: Context): Promise<void> {
const hasLandmarks = await ctx.session.runScript(`
document.querySelector('header') &&
document.querySelector('main') &&
document.querySelector('footer');
Function create
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async create(ctx: Context): Promise<void> {
const inputs = await this.findAllInputs(ctx);
if (inputs.length === 0) {
return ctx.reportHTML({
Function create
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
async create(ctx: Context): Promise<void> {
const xpaths = await ctx.session.runScript<string[]>(`
visible
.$$('img')
.map((elm) => visible.createXPath(elm));
- 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 toAsyncIterator
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function toAsyncIterator<T>(
stream$: Observable<T>,
): AsyncIterableIterator<T> {
const queue: Queue<T> = [];
const yields: T[] = [];
Function Imprint
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Imprint = () => {
const { t } = useTranslation();
return (
<div>
Function create
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async create(ctx: Context): Promise<void> {
const result = await ctx.session.findHTML('/html');
if (result == null) return;
const [, node] = result;
Function Item
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Item = (props: NavItem) => {
const { href, as: _as, children, icon } = props;
const router = useRouter();
const variant = useVariant();
Function PagePlaceholder
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const PagePlaceholder = () => {
const router = useRouter();
const { t } = useTranslation();
return (