ComplianceAsCode/content

View on GitHub

Showing 1,093 of 1,093 total issues

File build_yaml.py has 2854 lines of code (exceeds 400 allowed). Consider refactoring.
Open

"""
Common functions for building YAML in SSG.
Also contains definitions of basic classes like Rule, Group, Value and Platform.
"""
 
 
Severity: Major
Found in ssg/build_yaml.py - About 1 wk to fix

    Function parse has a Cognitive Complexity of 142 (exceeds 7 allowed). Consider refactoring.
    Open

    def parse(self, expr, simplify=False):
    """
    Return a boolean expression parsed from `expr` either a unicode string
    or tokens iterable.
     
     
    Severity: Minor
    Found in ssg/ext/boolean/boolean.py - About 2 days to fix

    File boolean.py has 1126 lines of code (exceeds 400 allowed). Consider refactoring.
    Open

    """
    Boolean expressions algebra.
     
    This module defines a Boolean algebra over the set {TRUE, FALSE} with boolean
    variables called Symbols and the boolean functions AND, OR, NOT.
    Severity: Major
    Found in ssg/ext/boolean/boolean.py - About 2 days to fix

      File test_macros_oval.py has 1022 lines of code (exceeds 400 allowed). Consider refactoring.
      Open

      #!/usr/bin/python3
       
      import argparse
       
      import oval_tester
      Severity: Major
      Found in tests/test_macros_oval.py - About 2 days to fix

        Function show_profile_stats has a Cognitive Complexity of 103 (exceeds 7 allowed). Consider refactoring.
        Open

        def show_profile_stats(self, profile, options):
        """Displays statistics for specific profile"""
         
        profile_stats = self.get_profile_stats(profile)
        rules_count = profile_stats['rules_count']
        Severity: Minor
        Found in ssg/build_profile.py - About 2 days to fix

        Function main has a Cognitive Complexity of 97 (exceeds 7 allowed). Consider refactoring.
        Open

        def main():
        global exit_value
        (options, args) = parse_options()
        xccdffilename = args[0]
         
         
        Severity: Minor
        Found in build-scripts/verify_references.py - About 1 day to fix

        File controls.py has 910 lines of code (exceeds 400 allowed). Consider refactoring.
        Open

        """
        Common functions for processing Controls in SSG
        """
         
        import collections
        Severity: Major
        Found in ssg/controls.py - About 1 day to fix

          Cyclomatic complexity is too high in method get_profile_stats. (85)
          Open

          def get_profile_stats(self, profile):
          """Obtain statistics for the profile"""
           
          # Holds the intermediary statistics for profile
          profile_stats = {
          Severity: Minor
          Found in ssg/build_profile.py by radon

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

          Severity: Major
          Found in shared/templates/file_groupowner/template.py and 1 other location - About 1 day to fix
          shared/templates/file_owner/template.py on lines 0..25

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

          Severity: Major
          Found in shared/templates/file_owner/template.py and 1 other location - About 1 day to fix
          shared/templates/file_groupowner/template.py on lines 0..25

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

          if "greater" in data["operation"]:
          if data["zero_comparison_operation"]:
          if "greater" in data["zero_comparison_operation"]:
          data["test_var_value"] = "-2"
          data["test_correct_value"] = "1"
          Severity: Major
          Found in shared/templates/accounts_password/template.py and 1 other location - About 1 day to fix
          shared/templates/accounts_password/template.py on lines 21..36

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

          elif "less" in data["operation"]:
          if data["zero_comparison_operation"]:
          if "greater" in data["zero_comparison_operation"]:
          data["test_var_value"] = "2"
          data["test_correct_value"] = "1"
          Severity: Major
          Found in shared/templates/accounts_password/template.py and 1 other location - About 1 day to fix
          shared/templates/accounts_password/template.py on lines 4..19

          File build_profile.py has 736 lines of code (exceeds 400 allowed). Consider refactoring.
          Open

          from __future__ import absolute_import
          from __future__ import print_function
           
          import os
          import sys
          Severity: Major
          Found in ssg/build_profile.py - About 1 day to fix

            File xml.py has 726 lines of code (exceeds 400 allowed). Consider refactoring.
            Open

            """
            Common functions for processing XML in SSG
            """
             
            from __future__ import absolute_import
            Severity: Major
            Found in ssg/xml.py - About 1 day to fix

              Cyclomatic complexity is too high in method show_profile_stats. (57)
              Open

              def show_profile_stats(self, profile, options):
              """Displays statistics for specific profile"""
               
              profile_stats = self.get_profile_stats(profile)
              rules_count = profile_stats['rules_count']
              Severity: Minor
              Found in ssg/build_profile.py by radon

              Cyclomatic complexity is too high in method parse. (56)
              Open

              def parse(self, expr, simplify=False):
              """
              Return a boolean expression parsed from `expr` either a unicode string
              or tokens iterable.
               
               
              Severity: Minor
              Found in ssg/ext/boolean/boolean.py by radon

              Cyclomatic complexity is too high in function main. (55)
              Open

              def main():
              global exit_value
              (options, args) = parse_options()
              xccdffilename = args[0]
               
               
              Severity: Minor
              Found in build-scripts/verify_references.py by radon

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

              def to_ansible_conditional(self):
              child_ansible_conds = [
              a.to_ansible_conditional() for a in self.args
              if a.to_ansible_conditional() != '']
               
               
              Severity: Major
              Found in ssg/build_cpe.py and 1 other location - About 1 day to fix
              ssg/build_cpe.py on lines 316..335

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

              def to_bash_conditional(self):
              child_bash_conds = [
              a.to_bash_conditional() for a in self.args
              if a.to_bash_conditional() != '']
               
               
              Severity: Major
              Found in ssg/build_cpe.py and 1 other location - About 1 day to fix
              ssg/build_cpe.py on lines 337..356

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

              shared/templates/audit_rules_file_deletion_events/template.py on lines 0..18
              Severity
              Category
              Status
              Source
              Language