shmilylty/OneForAll

View on GitHub

Showing 114 of 114 total issues

Identical blocks of code found in 8 locations. Consider refactoring.
Open

    def run(self):
        """
        类执行入口
        """
        self.begin()
Severity: Major
Found in modules/search/wzsearch.py and 7 other locations - About 7 hrs to fix
modules/search/ask.py on lines 38..55
modules/search/bing.py on lines 47..65
modules/search/google.py on lines 50..69
modules/search/so.py on lines 43..61
modules/search/sogou.py on lines 40..58
modules/search/yahoo.py on lines 49..67
modules/search/yandex.py on lines 47..66

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 8 locations. Consider refactoring.
Open

    def run(self):
        """
        类执行入口
        """
        self.begin()
Severity: Major
Found in modules/search/ask.py and 7 other locations - About 7 hrs to fix
modules/search/bing.py on lines 47..65
modules/search/google.py on lines 50..69
modules/search/so.py on lines 43..61
modules/search/sogou.py on lines 40..58
modules/search/wzsearch.py on lines 37..54
modules/search/yahoo.py on lines 49..67
modules/search/yandex.py on lines 47..66

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 8 locations. Consider refactoring.
Open

    def run(self):
        """
        类执行入口
        """
        self.begin()
Severity: Major
Found in modules/search/google.py and 7 other locations - About 7 hrs to fix
modules/search/ask.py on lines 38..55
modules/search/bing.py on lines 47..65
modules/search/so.py on lines 43..61
modules/search/sogou.py on lines 40..58
modules/search/wzsearch.py on lines 37..54
modules/search/yahoo.py on lines 49..67
modules/search/yandex.py on lines 47..66

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 8 locations. Consider refactoring.
Open

    def run(self):
        """
        类执行入口
        """
        self.begin()
Severity: Major
Found in modules/search/yandex.py and 7 other locations - About 7 hrs to fix
modules/search/ask.py on lines 38..55
modules/search/bing.py on lines 47..65
modules/search/google.py on lines 50..69
modules/search/so.py on lines 43..61
modules/search/sogou.py on lines 40..58
modules/search/wzsearch.py on lines 37..54
modules/search/yahoo.py on lines 49..67

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 8 locations. Consider refactoring.
Open

    def run(self):
        """
        类执行入口
        """
        self.begin()
Severity: Major
Found in modules/search/yahoo.py and 7 other locations - About 7 hrs to fix
modules/search/ask.py on lines 38..55
modules/search/bing.py on lines 47..65
modules/search/google.py on lines 50..69
modules/search/so.py on lines 43..61
modules/search/sogou.py on lines 40..58
modules/search/wzsearch.py on lines 37..54
modules/search/yandex.py on lines 47..66

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 8 locations. Consider refactoring.
Open

    def run(self):
        """
        类执行入口
        """
        self.begin()
Severity: Major
Found in modules/search/sogou.py and 7 other locations - About 7 hrs to fix
modules/search/ask.py on lines 38..55
modules/search/bing.py on lines 47..65
modules/search/google.py on lines 50..69
modules/search/so.py on lines 43..61
modules/search/wzsearch.py on lines 37..54
modules/search/yahoo.py on lines 49..67
modules/search/yandex.py on lines 47..66

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          def __init__(self, domain):
              Search.__init__(self)
              self.domain = domain
              self.module = 'Search'
              self.source = 'ZoomEyeAPISearch'
      Severity: Major
      Found in modules/search/zoomeye_api.py and 1 other location - About 2 hrs to fix
      modules/search/quake_api.py on lines 8..15

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 60.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          def __init__(self, domain):
              Search.__init__(self)
              self.domain = domain
              self.module = 'Quake'
              self.source = "QuakeAPISearch"
      Severity: Major
      Found in modules/search/quake_api.py and 1 other location - About 2 hrs to fix
      modules/search/zoomeye_api.py on lines 7..14

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 60.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          def __init__(self, domain):
              Query.__init__(self)
              self.domain = domain
              self.module = 'Dataset'
              self.source = 'NetCraftQuery'
      Severity: Major
      Found in modules/datasets/netcraft.py and 2 other locations - About 2 hrs to fix
      modules/search/ask.py on lines 6..13
      modules/search/so.py on lines 7..14

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 58.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          def __init__(self, domain):
              Search.__init__(self)
              self.domain = domain
              self.module = 'Search'
              self.source = 'AskSearch'
      Severity: Major
      Found in modules/search/ask.py and 2 other locations - About 2 hrs to fix
      modules/datasets/netcraft.py on lines 10..17
      modules/search/so.py on lines 7..14

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 58.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          def __init__(self, domain):
              Search.__init__(self)
              self.domain = domain
              self.module = 'Search'
              self.source = 'SoSearch'
      Severity: Major
      Found in modules/search/so.py and 2 other locations - About 2 hrs to fix
      modules/datasets/netcraft.py on lines 10..17
      modules/search/ask.py on lines 6..13

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 58.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      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
          Severity
          Category
          Status
          Source
          Language