natlas/natlas-libnmap

View on GitHub
libnmap/parser.py

Summary

Maintainability
F
3 days
Test Coverage

File parser.py has 586 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-


try:
    import xml.etree.cElementTree as ET
Severity: Major
Found in libnmap/parser.py - About 1 day to fix

    Function __parse_script has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

        def __parse_script(cls, script_data):
            """
                Private method parsing the data from NSE scripts output
    
                :param script_data: portion of XML describing the results of the
    Severity: Minor
    Found in libnmap/parser.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

    Cyclomatic complexity is too high in method _parse_xml_host. (13)
    Open

        @classmethod
        def _parse_xml_host(cls, scanhost_data):
            """
                Protected method parsing a portion of a nmap scan result.
                Receives a <host> XML tag representing a scanned host with
    Severity: Minor
    Found in libnmap/parser.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in method _parse_xml_port. (11)
    Open

        @classmethod
        def _parse_xml_port(cls, scanport_data):
            """
                Protected method parsing a scanned service from a targeted host.
                This protected method cannot be called directly.
    Severity: Minor
    Found in libnmap/parser.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in method _parse_xml. (9)
    Open

        @classmethod
        def _parse_xml(cls, nmap_data=None, incomplete=False):
            """
                Protected class method used to process a specific data type.
                In this case: XML. This method is called by cls.parse class
    Severity: Minor
    Found in libnmap/parser.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in method __parse_script. (9)
    Open

        @classmethod
        def __parse_script(cls, script_data):
            """
                Private method parsing the data from NSE scripts output
    
    
    Severity: Minor
    Found in libnmap/parser.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

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

        def _parse_xml_host(cls, scanhost_data):
            """
                Protected method parsing a portion of a nmap scan result.
                Receives a <host> XML tag representing a scanned host with
                its services.
    Severity: Minor
    Found in libnmap/parser.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

    NmapParser has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class NmapParser(object):
        @classmethod
        def parse(cls, nmap_data=None, data_type="XML", incomplete=False):
            """
                Generic class method of NmapParser class.
    Severity: Minor
    Found in libnmap/parser.py - About 2 hrs to fix

      Cyclomatic complexity is too high in method _parse_xml_report. (6)
      Open

          @classmethod
          def _parse_xml_report(cls, root=None):
              """
                  This method parses out a full nmap scan report from its XML root
                  node: <nmaprun>.
      Severity: Minor
      Found in libnmap/parser.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method __parse_os_fingerprint. (6)
      Open

          @classmethod
          def __parse_os_fingerprint(cls, os_data):
              """
                  Private method parsing the data from an OS fingerprint (-O).
                  Contents of <os> is returned as a dict.
      Severity: Minor
      Found in libnmap/parser.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Function _parse_xml_port has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def _parse_xml_port(cls, scanport_data):
              """
                  Protected method parsing a scanned service from a targeted host.
                  This protected method cannot be called directly.
                  A <port/> tag can be directly passed to parse() and the below
      Severity: Minor
      Found in libnmap/parser.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 _parse_xml has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def _parse_xml(cls, nmap_data=None, incomplete=False):
              """
                  Protected class method used to process a specific data type.
                  In this case: XML. This method is called by cls.parse class
                  method and receives nmap scan results data (in XML).
      Severity: Minor
      Found in libnmap/parser.py - About 55 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 not isinstance(tdict[tkey], list):
                                  tdict[tkey] = [
                                      tdict[tkey],
                                  ]
                              tdict[tkey].append(telem.text)
      Severity: Major
      Found in libnmap/parser.py - About 45 mins to fix

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

            def __parse_os_fingerprint(cls, os_data):
                """
                    Private method parsing the data from an OS fingerprint (-O).
                    Contents of <os> is returned as a dict.
        
        
        Severity: Minor
        Found in libnmap/parser.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 _parse_xml_report has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def _parse_xml_report(cls, root=None):
                """
                    This method parses out a full nmap scan report from its XML root
                    node: <nmaprun>.
        
        
        Severity: Minor
        Found in libnmap/parser.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

        Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed.
        Open

            def _parse_xml_host(cls, scanhost_data):
        Severity: Critical
        Found in libnmap/parser.py by sonar-python

        Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

        See

        Refactor this function to reduce its Cognitive Complexity from 25 to the 15 allowed.
        Open

            def __parse_script(cls, script_data):
        Severity: Critical
        Found in libnmap/parser.py by sonar-python

        Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

        See

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

                            if not isinstance(_elt_dict[skey], list):
                                _elt_dict[skey] = [
                                    _elt_dict[skey],
        Severity: Major
        Found in libnmap/parser.py and 1 other location - About 1 hr to fix
        libnmap/parser.py on lines 488..490

        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 38.

        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

                                if not isinstance(tdict[tkey], list):
                                    tdict[tkey] = [
                                        tdict[tkey],
        Severity: Major
        Found in libnmap/parser.py and 1 other location - About 1 hr to fix
        libnmap/parser.py on lines 498..500

        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 38.

        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

                    elif xport.tag == "owner":
                        _owner = cls.__format_attributes(xport)
                    elif xport.tag == "script":
                        _script_dict = cls.__parse_script(xport)
                        _service_scripts.append(_script_dict)
        Severity: Minor
        Found in libnmap/parser.py and 2 other locations - About 30 mins to fix
        libnmap/parser.py on lines 522..525
        libnmap/parser.py on lines 556..561

        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 32.

        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

                    elif xos.tag == "portused":
                        os_portused = cls.__format_attributes(xos)
                        os_ports_used.append(os_portused)
                    elif xos.tag == "osfingerprint":
                        os_fp_dict = cls.__format_attributes(xos)
        Severity: Minor
        Found in libnmap/parser.py and 2 other locations - About 30 mins to fix
        libnmap/parser.py on lines 407..411
        libnmap/parser.py on lines 522..525

        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 32.

        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

                for xscript in scripts_data:
                    if xscript.tag == "script":
                        _script_dict = cls.__parse_script(xscript)
                        _host_scripts.append(_script_dict)
        Severity: Minor
        Found in libnmap/parser.py and 2 other locations - About 30 mins to fix
        libnmap/parser.py on lines 407..411
        libnmap/parser.py on lines 556..561

        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 32.

        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

        Line too long (84 > 79 characters)
        Open

                        "No report data to parse: please " "provide a valid XML nmap report"
        Severity: Minor
        Found in libnmap/parser.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (84 > 79 characters)
        Open

                    _stime, _etime, _addresses, _status, _hostnames, _services, _host_extras
        Severity: Minor
        Found in libnmap/parser.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Do not use bare 'except'
        Open

                except:
        Severity: Minor
        Found in libnmap/parser.py by pep8

        When catching exceptions, mention specific exceptions when possible.

        Okay: except Exception:
        Okay: except BaseException:
        E722: except:

        Line too long (88 > 79 characters)
        Open

                    raise NmapParserException("Unpexpected data structure for XML " "root node")
        Severity: Minor
        Found in libnmap/parser.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (81 > 79 characters)
        Open

            def parse_fromfile(cls, nmap_report_path, data_type="XML", incomplete=False):
        Severity: Minor
        Found in libnmap/parser.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Do not use bare 'except'
        Open

                except:
        Severity: Minor
        Found in libnmap/parser.py by pep8

        When catching exceptions, mention specific exceptions when possible.

        Okay: except Exception:
        Okay: except BaseException:
        E722: except:

        Line too long (85 > 79 characters)
        Open

                    raise NmapParserException("No root node provided to parse XML " "report")
        Severity: Minor
        Found in libnmap/parser.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Do not use bare 'except'
        Open

                    except:
        Severity: Minor
        Found in libnmap/parser.py by pep8

        When catching exceptions, mention specific exceptions when possible.

        Okay: except Exception:
        Okay: except BaseException:
        E722: except:

        Line too long (84 > 79 characters)
        Open

                nmap_scan = {"_nmaprun": {}, "_scaninfo": {}, "_hosts": [], "_runstats": {}}
        Severity: Minor
        Found in libnmap/parser.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (81 > 79 characters)
        Open

                        "bad argument type for " "xarse_fromstring(): should be a string"
        Severity: Minor
        Found in libnmap/parser.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (82 > 79 characters)
        Open

                        "Error while trying to parse supplied " "data: unsupported format"
        Severity: Minor
        Found in libnmap/parser.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        There are no issues that match your filters.

        Category
        Status