ComplianceAsCode/content

View on GitHub
ssg/rule_dir_stats.py

Summary

Maintainability
D
F
+3 hrs
Test Coverage

File rule_dir_stats.py has 453 lines of code (exceeds 400 allowed). Consider refactoring.
New

"""
This module contains common code shared by utils/rule_dir_stats.py and utils/rule_dir_diff.py.
This code includes functions for walking the output of the utils/rule_dir_json.py script, and
filtering functions used in both scripts.
"""
Severity: Minor
Found in ssg/rule_dir_stats.py - About 3 hrs to fix

    Line too long (111 > 99 characters)
    New

                - right_changed_data: Data for rules in both left_rules and right_rules but changed in right_rules.
    Severity: Minor
    Found in ssg/rule_dir_stats.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 (100 > 99 characters)
    New

        Walk a dictionary of known_rules and generate simple aggregate statistics for all visited rules.
    Severity: Minor
    Found in ssg/rule_dir_stats.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 (121 > 99 characters)
    New

                - affected_remediations_type (defaultdict): A dictionary with the count of each type of affected remediation.
    Severity: Minor
    Found in ssg/rule_dir_stats.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 (100 > 99 characters)
    New

            rule_obj (dict): A dictionary representing a rule object. It should have the following keys:
    Severity: Minor
    Found in ssg/rule_dir_stats.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 (101 > 99 characters)
    New

            rule_output (dict): The output of a rule containing information about ovals and remediations.
    Severity: Minor
    Found in ssg/rule_dir_stats.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 (109 > 99 characters)
    New

                - left_changed_data: Data for rules in both left_rules and right_rules but changed in left_rules.
    Severity: Minor
    Found in ssg/rule_dir_stats.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 (103 > 99 characters)
    New

                - all_affected_remediations (int): The number of rules where all remediations are affected.
    Severity: Minor
    Found in ssg/rule_dir_stats.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 (112 > 99 characters)
    New

                - affected_remediations_type (dict): Dictionary with the count of each type of affected remediation.
    Severity: Minor
    Found in ssg/rule_dir_stats.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 (100 > 99 characters)
    New

                 name. The message format is "rule_id:<rule_id> has a different product and OVALs names:
    Severity: Minor
    Found in ssg/rule_dir_stats.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 (107 > 99 characters)
    New

            remediation_func (function): A function to be called for each rule to generate remediation content.
    Severity: Minor
    Found in ssg/rule_dir_stats.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