owasp-amass/amass

View on GitHub

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)
Severity: Minor
Found in cmd/amass/enum.go - About 1 day to fix

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(),
Severity: Minor
Found in cmd/amass/intel.go - About 6 hrs to fix

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(),
Severity: Minor
Found in cmd/amass/enum.go - About 4 hrs to fix

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
    }
Severity: Minor
Found in enum/enum.go - About 4 hrs to fix

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
    }

Severity: Minor
Found in intel/intel.go - About 4 hrs to fix

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:
Severity: Minor
Found in net/http/http.go - About 4 hrs to fix

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
Severity: Minor
Found in cmd/amass/enum.go - About 4 hrs to fix

    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)
    Severity: Minor
    Found in enum/names.go - About 3 hrs to fix

    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)
    Severity: Minor
    Found in datasrcs/scripting/new.go - About 3 hrs to fix

    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
    Severity: Minor
    Found in cmd/amass/io.go - About 3 hrs to fix

    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:
    Severity: Minor
    Found in datasrcs/scripting/script.go - About 3 hrs to fix

    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 {
    Severity: Minor
    Found in cmd/amass/enum.go - About 3 hrs to fix

    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
        }
    Severity: Minor
    Found in enum/monitor.go - About 2 hrs to fix

    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
    Severity: Minor
    Found in intel/intel.go - About 2 hrs to fix

    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
    Severity: Minor
    Found in datasrcs/scripting/script.go - About 2 hrs to fix

    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
    Severity: Minor
    Found in datasrcs/scripting/http.go - About 2 hrs to fix

    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 {
    Severity: Minor
    Found in requests/asncache.go - About 2 hrs to fix

    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)
    Severity: Minor
    Found in cmd/amass/intel.go - About 2 hrs to fix

    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
    Severity: Minor
    Found in datasrcs/scripting/http.go - About 2 hrs to fix

    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]
    Severity: Minor
    Found in requests/asncache.go - About 2 hrs to fix

    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

    Severity
    Category
    Status
    Source
    Language