Showing 121 of 1,434 total issues
Function processEnumInputFiles
has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring. Open
func processEnumInputFiles(args *enumArgs) error {
if args.Options.BruteForcing {
if len(args.Filepaths.BruteWordlist) > 0 {
for _, f := range args.Filepaths.BruteWordlist {
list, err := config.GetListFromFile(f)
- 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 runIntelCommand
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
func runIntelCommand(clArgs []string) {
args := intelArgs{
Domains: stringset.New(),
Excluded: stringset.New(),
Included: stringset.New(),
- 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 argsAndConfig
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
func argsAndConfig(clArgs []string) (*config.Config, *enumArgs) {
args := enumArgs{
AltWordList: stringset.New(),
AltWordListMask: stringset.New(),
BruteWordList: stringset.New(),
- 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 Enumeration.manageDataSrcRequests
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
func (e *Enumeration) manageDataSrcRequests() {
nameToSrc := make(map[string]service.Service)
for _, src := range e.srcs {
nameToSrc[src.String()] = src
}
- 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 Collection.ReverseWhois
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
func (c *Collection) ReverseWhois() error {
if err := c.Config.CheckSettings(); err != nil {
return 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 Crawl
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
func Crawl(ctx context.Context, u string, scope []string, max int, callback func(*Request, *Response)) error {
select {
case <-ctx.Done():
return fmt.Errorf("the context expired")
default:
- 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 enum.go
has 583 lines of code (exceeds 500 allowed). Consider refactoring. Open
// Copyright © by Jeff Foley 2017-2023. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// SPDX-License-Identifier: Apache-2.0
package main
Method subdomainTask.linkNodesToApexes
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
func (r *subdomainTask) linkNodesToApexes() {
apexes := make(map[string]*types.Asset)
for k := range r.possibleApexes {
res, err := r.enum.graph.DB.FindByContent(domain.FQDN{Name: k}, r.enum.Config.CollectionStartTime)
- 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 Script.newASN
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
func (s *Script) newASN(L *lua.LState) int {
if ctx, err := extractContext(L.CheckUserData(1)); err == nil && !contextExpired(ctx) {
if params := L.CheckTable(2); err == nil && params != nil {
addr, _ := getStringField(L, params, "addr")
ip := net.ParseIP(addr)
- 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 EventOutput
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
func EventOutput(ctx context.Context, g *netmap.Graph, domains []string, since time.Time, f *stringset.Set, asninfo bool, cache *requests.ASNCache) []*requests.Output {
var res []*requests.Output
if len(domains) == 0 {
return res
- 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 Script.dispatch
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
func (s *Script) dispatch(in interface{}) {
s.cbsLock.Lock()
switch req := in.(type) {
case *requests.DNSRequest:
- 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 enumArgs.OverrideConfig
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
func (e enumArgs) OverrideConfig(conf *config.Config) error {
if len(e.Addresses) > 0 {
conf.Scope.Addresses = e.Addresses
}
if len(e.ASNs) > 0 {
- 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 Enumeration.checkForMissedWildcards
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
func (e *Enumeration) checkForMissedWildcards(addr string) {
ip, err := netip.ParseAddr(addr)
if err != nil {
return
}
- 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 Collection.makeDNSTaskFunc
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
func (c *Collection) makeDNSTaskFunc() pipeline.TaskFunc {
return pipeline.TaskFunc(func(ctx context.Context, data pipeline.Data, tp pipeline.TaskParams) (pipeline.Data, error) {
select {
case <-ctx.Done():
return nil, 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
Method Script.HandlesReq
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
func (s *Script) HandlesReq(req interface{}) bool {
s.cbsLock.Lock()
defer s.cbsLock.Unlock()
var handles bool
- 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 Script.scrape
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
func (s *Script) scrape(L *lua.LState) int {
ctx, err := extractContext(L.CheckUserData(1))
if err != nil {
L.Push(lua.LFalse)
return 1
- 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 ASNCache.rawData2Ranger
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
func (c *ASNCache) rawData2Ranger(ip net.IP) {
var cidr *net.IPNet
var data *ASNRequest
for _, record := range c.cache {
- 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 processIntelInputFiles
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
func processIntelInputFiles(args *intelArgs) error {
if args.Filepaths.ExcludedSrcs != "" {
list, err := config.GetListFromFile(args.Filepaths.ExcludedSrcs)
if err != nil {
return fmt.Errorf("failed to parse the exclude file: %v", 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
Method Script.crawl
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
func (s *Script) crawl(L *lua.LState) int {
cfg := s.sys.Config()
ctx, err := extractContext(L.CheckUserData(1))
if err != nil {
return 0
- 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 ASNCache.Update
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
func (c *ASNCache) Update(req *ASNRequest) {
c.Lock()
defer c.Unlock()
as, found := c.cache[req.ASN]
- 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"