shmilylty/OneForAll

View on GitHub

Showing 84 of 114 total issues

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

def export_data(target, db=None, alive=False, limit=None, path=None, fmt='csv', show=False):
    """
    OneForAll export from database module

    Example:
Severity: Minor
Found in export.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 filter_name has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def filter_name(path):
    for name in black_name:
        if path.endswith(name):
            return True
    black_ext = ['io.js', 'ui.js', 'fp.js', 'en.js', 'en-us,js', 'zh.js', 'zh-cn.js',
Severity: Minor
Found in modules/finder.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, domain, filtered_subdomain=''):
        """
        发送搜索请求并做子域匹配

        :param str domain: 域名
Severity: Minor
Found in modules/search/sogou.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

Avoid too many return statements within this function.
Open

        return True
Severity: Major
Found in modules/finder.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return repr(text)
    Severity: Major
    Found in common/request.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                          return
      Severity: Major
      Found in modules/datasets/cloudflare_api.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return True
        Severity: Major
        Found in modules/finder.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                              return
          Severity: Major
          Found in modules/datasets/cloudflare_api.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                            return
            Severity: Major
            Found in modules/datasets/cloudflare_api.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return desc['content']
              Severity: Major
              Found in common/request.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return word['content']
                Severity: Major
                Found in common/request.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return 'None'
                  Severity: Major
                  Found in common/request.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return True
                    Severity: Major
                    Found in modules/finder.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return filter_name(path)
                      Severity: Major
                      Found in modules/finder.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return True
                        Severity: Major
                        Found in modules/finder.py - About 30 mins to fix

                          Function first has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def first(self, default=None, as_dict=False, as_ordereddict=False):
                                  """Returns a single record for the RecordCollection, or `default`. If
                                  `default` is an instance or subclass of Exception, then raise it
                                  instead of returning it."""
                          
                          
                          Severity: Minor
                          Found in common/records.py - About 25 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 find_subdomains has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def find_subdomains(domain, data):
                              subdomains = set()
                              js_urls = set()
                              db = Database()
                              for infos in data:
                          Severity: Minor
                          Found in modules/finder.py - About 25 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 recursive_subdomain has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def recursive_subdomain(self):
                                  # 递归搜索下一层的子域
                                  # 从1开始是之前已经做过1层子域搜索了,当前实际递归层数是layer+1
                                  subdomains = self.subdomains.copy()
                                  for layer_num in range(1, self.recursive_times):
                          Severity: Minor
                          Found in common/search.py - About 25 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 extract_words has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def extract_words(self):
                                  """
                                  Extend the dictionary based on target's domain naming conventions
                                  """
                          
                          
                          Severity: Minor
                          Found in modules/altdns.py - About 25 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 compare has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def compare(self, subdomain, cname, responses):
                                  domain_resp = self.get('http://' + subdomain, check=False, ignore=True)
                                  cname_resp = self.get('http://' + cname, check=False, ignore=True)
                                  if domain_resp is None or cname_resp is None:
                                      return
                          Severity: Minor
                          Found in takeover.py - About 25 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