Showing 1,971 of 13,422 total issues
Function ImageUploader
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ImageUploader() {
const [uploadedImage, setUploadedImage] = useState(null)
const [processedImage, setProcessedImage] = useState(null)
const t = useTranslations('ReturnToMonke')
EVM
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
type EVM struct {
mock.Mock
}
EVMClient
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
type EVMClient struct {
mock.Mock
}
DeployManager
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
func (d *DeployManager) GetOrigin(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *origin.OriginRef) {
d.T().Helper()
return manager.GetContract[*origin.OriginRef](ctx, d.T(), d, backend, OriginType)
}
File index.tsx
has 353 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { TRANSACTIONS_PATH } from '@urls'
import { useState, useEffect } from 'react'
import { OverviewChart } from '@components/ChainChart'
import TextField from '@mui/material/TextField'
import { inputStyle } from '@utils/styles/muiStyles'
Method Executor.executeExecutable
has a Cognitive Complexity of 45 (exceeds 20 allowed). Consider refactoring. Open
func (e Executor) executeExecutable(parentCtx context.Context, chainID uint32) (err error) {
backoffInterval := time.Duration(0)
for {
select {
case <-parentCtx.Done():
- 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
Method Guard.handleStatusUpdated
has a Cognitive Complexity of 45 (exceeds 20 allowed). Consider refactoring. Open
func (g Guard) handleStatusUpdated(ctx context.Context, log ethTypes.Log, chainID uint32) error {
statusUpdated, err := g.bondingManagerParser.ParseStatusUpdated(log)
if err != nil {
return fmt.Errorf("could not parse status updated: %w", err)
}
- 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 Grid
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
export default function Grid({
children,
cols,
gap,
gapX,
- 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 SynapseLogoWithTitleSvg
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function SynapseLogoWithTitleSvg() {
return (
<svg
width="169"
height="36"
File swapEthWrapper.ts
has 345 lines of code (exceeds 250 allowed). Consider refactoring. Open
export const SWAP_ETH_WRAPPER_ABI = [
{
inputs: [
{
internalType: 'address payable',
File index.tsx
has 345 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { BigNumber } from '@ethersproject/bignumber'
import * as CHAINS from '@constants/chains/master'
import { getAddress } from 'viem'
export type Chain = {
Function TestNewContext
has a Cognitive Complexity of 44 (exceeds 20 allowed). Consider refactoring. Open
func TestNewContext(t *testing.T) {
unsetGithubRepo(t)
t.Run("with GITHUB_EVENT_PATH set", func(t *testing.T) {
res := mock.MustMarshal(github.PushEvent{
Repo: &github.PushEventRepository{
- 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 Grid
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
export const Grid = ({
children,
cols,
gap,
gapX,
- 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 standardizeResponse
has 131 lines of code (exceeds 50 allowed). Consider refactoring. Open
func standardizeResponse(ctx context.Context, req *rpc.Request, rpcMessage JSONRPCMessage) (out []byte, err error) {
// TODO: use a sync.pool for acquiring/releasing these structs
method := req.Method
OUTER:
Function SynapseLogoSvg
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const SynapseLogoSvg = () => {
return (
<svg
width="39"
height="36"
Function SynapseLogoSvg
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function SynapseLogoSvg() {
return (
<svg
width="39"
height="36"
Function UniversalMoneyMarketsIcon
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function UniversalMoneyMarketsIcon() {
return (
<svg
width="335"
height="196"
File [chainId].tsx
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
import _ from 'lodash'
import { useState, useEffect } from 'react'
import { useRouter } from 'next/router'
import { CHAINS } from '@synapsecns/synapse-constants'
import { useLazyQuery, useQuery } from '@apollo/client'
Client
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
type Client struct {
*rpc.Client
}
Function GetDefiLlamaData
has a Cognitive Complexity of 43 (exceeds 20 allowed). Consider refactoring. Open
func GetDefiLlamaData(ctx context.Context, timestamp int, coinGeckoID string) *float64 {
zero := float64(0)
if coinGeckoID == "NO_TOKEN" || coinGeckoID == "NO_PRICE" {
// if there is no data on the token, the amount returned will be 1:1 (price will be same as the amount of token
- 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"