shmilylty/OneForAll

View on GitHub

Showing 84 of 114 total issues

File utils.py has 647 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import os
import re
import sys
import time
import json
Severity: Major
Found in common/utils.py - About 1 day to fix

    File brute.py has 441 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #!/usr/bin/python3
    # coding=utf-8
    
    """
    OneForAll subdomain brute module
    Severity: Minor
    Found in brute.py - About 6 hrs to fix

      File module.py has 342 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """
      Module base class
      """
      
      import json
      Severity: Minor
      Found in common/module.py - About 4 hrs to fix

        Function _package has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
        Open

            def _package(self, dicts=True, ordered=True):
                """Packages Dataset into lists of dictionaries for transmission."""
                # TODO: Dicts default to false?
        
                _data = list(self._data)
        Severity: Minor
        Found in common/tablib/tablib.py - 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 query has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

            def query(self):
                """
                向接口查询子域并做子域匹配
                """
                self.header = self.get_header()
        Severity: Minor
        Found in modules/certificates/crtsh.py - 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 query has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            def query(self):
                """
                query from source
                """
                account_id_resp = self.get(self.addr + 'accounts')
        Severity: Minor
        Found in modules/datasets/cloudflare_api.py - 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 github_takeover has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

        def github_takeover(url):
            # 读取config配置文件
            repo_name = url
            print('[*]正在读取配置文件')
            user = settings.github_api_user
        Severity: Minor
        Found in modules/autotake/github.py - 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

        File wildcard.py has 267 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import secrets
        
        import tenacity
        from dns.exception import Timeout
        from dns.resolver import NXDOMAIN, YXDOMAIN, NoAnswer, NoNameservers
        Severity: Minor
        Found in modules/wildcard.py - About 2 hrs to fix

          Function convert_url has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

          def convert_url(req_url, rel_url):
              black_url = ["javascript:"]  # Add some keyword for filter url.
              raw_url = parse.urlparse(req_url)
              netloc = raw_url.netloc
              scheme = raw_url.scheme
          Severity: Minor
          Found in modules/finder.py - 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 __init__ has 17 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(self, target=None, targets=None, concurrent=None,
          Severity: Major
          Found in brute.py - About 2 hrs to fix

            Function search has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                def search(self):
                    """
                    向接口查询子域并做子域匹配
                    """
                    self.header = self.get_header()
            Severity: Minor
            Found in modules/search/github_api.py - 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 search has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                def search(self):
                    """
                    向接口查询子域并做子域匹配
                    """
                    page_num = 1
            Severity: Minor
            Found in modules/search/gitee.py - About 1 hr 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 query has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                def query(self):
                    """
                    向接口查询子域并做子域匹配
                    """
                    page = 0
            Severity: Minor
            Found in modules/datasets/ipv4info_api.py - About 1 hr 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 _validate has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                def _validate(self, row=None, col=None, safety=False):
                    """Assures size of every row in dataset is of proper proportions."""
                    if row:
                        is_valid = (len(row) == self.width) if self.width else True
                    elif col:
            Severity: Minor
            Found in common/tablib/tablib.py - About 1 hr 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 search has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                def search(self, domain, filtered_subdomain=''):
                    """
                    发送搜索请求并做子域匹配
            
                    :param str domain: 域名
            Severity: Minor
            Found in modules/search/baidu.py - About 1 hr 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 walk has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                def walk(self):
                    domain = self.domain
                    while True:
                        answer = utils.dns_query(domain, 'NSEC')
                        if answer is None:
            Severity: Minor
            Found in modules/check/nsec.py - About 1 hr 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 search has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                def search(self):
                    """
                    发送搜索请求并做子域匹配
                    """
                    self.per_page_num = 30
            Severity: Minor
            Found in modules/search/zoomeye_api.py - About 1 hr 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 gen_subdomains has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            def gen_subdomains(expression, path):
                """
                Generate subdomains
            
                :param  str  expression: generate subdomains expression
            Severity: Minor
            Found in brute.py - About 1 hr 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 gen_new_subdomains has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                def gen_new_subdomains(self):
                    for subdomain in self.now_subdomains:
                        subname, parts = split_domain(subdomain)
                        subnames = subname.split('.')
                        if settings.altdns_increase_num:
            Severity: Minor
            Found in modules/altdns.py - About 1 hr 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 __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(self, target=None, targets=None, brute=None, dns=None, req=None,
            Severity: Major
            Found in oneforall.py - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language