shmilylty/OneForAll

View on GitHub

Showing 84 of 114 total issues

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 __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 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 search has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def search(self):
                """
                发送搜索请求并做子域匹配
                """
                self.per_page_num = 100
        Severity: Minor
        Found in modules/search/quake_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 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 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/hunter_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 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

        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 suffix_index has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def suffix_index(self, lower_spl):
                """Returns the index of the first suffix label.
                Returns len(spl) if no suffix is found
                """
                length = len(lower_spl)
        Severity: Minor
        Found in common/tldextract.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 get_html_title has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def get_html_title(markup):
            """
            获取标题
        
            :param markup: html标签
        Severity: Minor
        Found in common/request.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 get_mod has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def get_mod(self):
                """
                Get modules
                """
                if settings.enable_all_module:
        Severity: Minor
        Found in modules/collect.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 query has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

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

        def update_data(data, infos):
            """
            更新解析结果
        
            :param list data: 待更新的数据列表
        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, 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

        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 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/so.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 check_cname_keyword has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def check_cname_keyword(cname):
            if not cname:
                return False
            names = cname.lower().split(',')
            for name in names:
        Severity: Minor
        Found in modules/iscdn.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