shmilylty/OneForAll

View on GitHub

Showing 114 of 114 total issues

Function _set_dict has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def _set_dict(self, pickle):
        """A native Python representation of the Dataset object. If headers have been
        set, a list of Python dictionaries will be returned. If no headers have been
        set, a list of tuples (rows) will be returned instead.

Severity: Minor
Found in common/tablib/tablib.py - About 45 mins 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 config_param has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def config_param(self):
        """
        Config parameter
        """
        if self.brute is None:
Severity: Minor
Found in oneforall.py - About 45 mins 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 check_header_key has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def check_header_key(header):
    if isinstance(header, str):
        header = json.loads(header)
    if isinstance(header, dict):
        header = set(map(lambda x: x.lower(), header.keys()))
Severity: Minor
Found in modules/iscdn.py - About 45 mins 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 run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def run(self):
        start = time.time()
        logger.log('INFOR', f'Start running {self.source} module')
        if isinstance(self.targets, set):
            self.subdomains = self.targets
Severity: Minor
Found in takeover.py - About 45 mins 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

Avoid deeply nested control flow statements.
Open

                    if page_r.status_code == 201:
                        print('[+]自动接管成功,请稍后访问http://' + str(url) + '查看结果')
                    else:
                        print('[+]开启Github pages失败,请检查网络或稍后重试')
                else:
Severity: Major
Found in modules/autotake/github.py - About 45 mins to fix

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

        def search(self, domain, filtered_subdomain=''):
            """
            发送搜索请求并做子域匹配
    
            :param str domain: 域名
    Severity: Minor
    Found in modules/search/yandex.py - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def search(self, domain, filtered_subdomain=''):
            """
            发送搜索请求并做子域匹配
    
            :param str domain: 域名
    Severity: Minor
    Found in modules/search/bing.py - About 45 mins 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_result_infos has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def gen_result_infos(items, infos, subdomains, appear_times, wc_ips, wc_ttl):
    Severity: Minor
    Found in brute.py - About 45 mins to fix

      Function replace_word has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def replace_word(self, subname):
              """
              If word longer than 3 is found in existing subdomain,
              replace it with other words from the dictionary
              """
      Severity: Minor
      Found in modules/altdns.py - About 45 mins 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 do_export has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def do_export(fmt, path, rows, show, domain, target):
      Severity: Minor
      Found in export.py - About 45 mins to fix

        Function filter_url has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        def filter_url(domain, url):
            try:
                raw_url = parse.urlparse(url)
            except Exception as e:  # 解析失败则跳过该URL
                logger.log('DEBUG', e.args)
        Severity: Minor
        Found in modules/finder.py - About 45 mins 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 head has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def head(self, url, params=None, check=True, **kwargs):
        Severity: Minor
        Found in common/module.py - About 35 mins to fix

          Function post has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def post(self, url, data=None, check=True, **kwargs):
          Severity: Minor
          Found in common/module.py - About 35 mins to fix

            Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(self, target=None, targets=None, thread=20, path=None, fmt='csv'):
            Severity: Minor
            Found in takeover.py - About 35 mins to fix

              Function __getitem__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __getitem__(self, key):
                      is_int = isinstance(key, int)
              
                      # Convert RecordCollection[1] into slice.
                      if is_int:
              Severity: Minor
              Found in common/records.py - About 35 mins 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 deal_output has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              def deal_output(output_path):
                  logger.log('INFOR', f'Processing resolved results')
                  infos = dict()  # 用来记录所有域名有关信息
                  with open(output_path) as fd:
                      for line in fd:
              Severity: Minor
              Found in common/resolve.py - About 35 mins 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 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def search(self):
                      """
                      发送搜索请求并做子域匹配
                      """
                      self.page_num = 1
              Severity: Minor
              Found in modules/search/fofa_api.py - About 35 mins 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 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def query(self):
                      """
                      向接口查询子域并做子域匹配
                      """
                      limit = 100
              Severity: Minor
              Found in modules/datasets/spyse_api.py - About 35 mins 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 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def query(self):
                      """
                      向接口查询子域并做子域匹配
                      """
                      self.header = self.get_header()  # NetCraft会检查User-Agent
              Severity: Minor
              Found in modules/datasets/netcraft.py - About 35 mins 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_fuzz_subdomains has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              def gen_fuzz_subdomains(expression, rule, fuzzlist):
                  """
                  Generate subdomains based on fuzz mode
              
                  :param  str  expression: generate subdomains expression
              Severity: Minor
              Found in brute.py - About 35 mins 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