Showing 1,971 of 13,422 total issues
Method server.StreamLogs
has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring. Open
func (s *server) StreamLogs(req *pbscribe.StreamLogsRequest, res pbscribe.ScribeService_StreamLogsServer) error {
streamNewBlocks := false
retrieveLogsBackoff := 3
fromBlock, toBlock, err := s.setBlocks(res.Context(), req)
if err != nil {
- 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 OpenGormClickhouse
has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring. Open
func OpenGormClickhouse(ctx context.Context, address string, readOnly bool, handler metrics.Handler) (*Store, error) {
clickhouseDB, err := gorm.Open(gormClickhouse.New(gormClickhouse.Config{
DSN: address,
}), &gorm.Config{
Logger: gormLogger.Default.LogMode(gormLogger.Silent),
- 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 TestNewBufferedPipe
has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring. Open
func TestNewBufferedPipe(t *testing.T) {
t.Run("Write and read data", func(t *testing.T) {
pipe := processlog.NewBufferedPipe()
testData := []byte("Hello, World!")
- 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 TestCombineStreams
has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring. Open
func TestCombineStreams(t *testing.T) {
tests := []struct {
name string
inputs []string
expectedOutput []string
- 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 HolisticStats
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export const HolisticStats = ({
platform: parentPlatform,
setPlatform: parentSetPlatform,
baseVariables,
- 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 SwapTransactionButton
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export const SwapTransactionButton = ({
isTyping,
approveTxn,
executeSwap,
isApproved,
- 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 BridgeButton
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export const BridgeButton = ({
originChain,
isValidQuote,
handleApprove,
handleBridge,
- 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 HarmonyProxy.getLogsHarmonyVerify
has 89 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (r *HarmonyProxy) getLogsHarmonyVerify(parentCtx context.Context, query ethereum.FilterQuery, rawBody []byte) (rawResp []byte, err error) {
ctx, span := r.tracer.Start(parentCtx, "getLogsHarmonyVerify")
defer func() {
metrics.EndSpanWithErr(span, err)
Function useSwapFromTokenListArray
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useSwapFromTokenListArray = (searchStr: string) => {
const { swapFromTokens, swapChainId } = useSwapState()
const portfolioBalances = usePortfolioBalances()
const chain = CHAINS_BY_ID[swapChainId]
Function useStaleQuoteUpdater
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useStaleQuoteUpdater = (
quote: BridgeQuote,
refreshQuoteCallback: () => Promise<void>,
enabled: boolean,
staleTimeout: number = 15000, // in ms
Function SocialButtons
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SocialButtons = () => {
return (
<Grid cols={{ xs: 2, sm: 1 }} gapY={1}>
<MiniInfoItem
href={DOCS_URL}
Function LanguageSelector
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const LanguageSelector = () => {
const router = useRouter()
const t = useTranslations('LanguageSelector')
const { pathname, asPath, query } = router
const [isOpen, setIsOpen] = useState(false)
Function SettingsSlideOver
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SettingsSlideOver = () => {
const dispatch = useAppDispatch()
const t = useTranslations('Settings')
const { showDestinationAddress } = useBridgeDisplayState()
Function destinationTxController
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const destinationTxController = async (req, res) => {
const errors = validationResult(req)
if (!errors.isEmpty()) {
return res.status(400).json({ errors: errors.array() })
}
File index.ts
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { BigNumber } from '@ethersproject/bignumber'
import { makeMultiChainObj } from '../utils/makeMultiChainObj'
import { validateAddresses } from '../utils/validateAddresses'
Method queryResolver.GetBridgeTxsFromOrigin
has 20 arguments (exceeds 4 allowed). Consider refactoring. Open
func (r *queryResolver) GetBridgeTxsFromOrigin(ctx context.Context, useMv *bool, chainIDFrom []*int, chainIDTo []*int, addressFrom *string, addressTo *string, maxAmount *int, minAmount *int, maxAmountUsd *int, minAmountUsd *int, startTime *int, endTime *int, txHash *string, tokenAddressTo []*string, tokenAddressFrom []*string, kappa *string, pending *bool, onlyCctp *bool, page *int, latest bool) ([]*model.BridgeTransaction, error) {
File main.go
has 520 lines of code (exceeds 500 allowed). Consider refactoring. Open
// Package main provides a tool for downloading and running specific versions of golangci-lint
// across different architectures and repositories. It supports version pinning through
// .golangci-version files and maintains a local cache of downloaded binaries.
//
// Security Features:
Method GuardSuite.TestGuardE2E
has 87 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (g GuardSuite) TestGuardE2E() {
testConfig := config.AgentConfig{
Domains: map[string]config.DomainConfig{
"origin_client": g.OriginDomainClient.Config(),
"destination_client": g.DestinationDomainClient.Config(),
Method ChainBackfiller.backfillContractLogs
has 87 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (c *ChainBackfiller) backfillContractLogs(parentCtx context.Context, contract indexerconfig.ContractConfig) (err error) {
// make the event parser
eventParser, err := c.makeEventParser(contract)
if err != nil {
return err
Method ScribeSuite.TestChainIndexerLivefillToTip
has 87 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (s *ScribeSuite) TestChainIndexerLivefillToTip() {
const numberOfContracts = 3
currentBlockHeight := uint64(10) // starting with zero to emit events while indexing.
chainID := gofakeit.Uint32()
chainBackends := make(map[uint32]geth.Backend)