ComplianceAsCode/content

View on GitHub

Showing 238 of 1,093 total issues

Avoid too many return statements within this function.
Open

return self.__class__(*args).simplify()
Severity: Major
Found in ssg/ext/boolean/boolean.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

    return self._generate_defaults_content()
    Severity: Major
    Found in utils/ansible_playbook_to_role.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

      return args[0]
      Severity: Major
      Found in ssg/ext/boolean/boolean.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

        return 0
        Severity: Major
        Found in utils/add_kubernetes_rule.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

          return expr
          Severity: Major
          Found in ssg/ext/boolean/boolean.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

            return self.annihilator
            Severity: Major
            Found in ssg/ext/boolean/boolean.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

              return args[0]
              Severity: Major
              Found in ssg/ext/boolean/boolean.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                return self._final_scan_went_ok(runner, rule_id)
                Severity: Major
                Found in tests/ssg_test_suite/rule.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                  return proposed
                  Severity: Major
                  Found in utils/compare_results.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                    return current_status
                    Severity: Major
                    Found in utils/compare_results.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                      return current_status
                      Severity: Major
                      Found in utils/compare_results.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                        return False
                        Severity: Major
                        Found in tests/ssg_test_suite/rule.py - About 30 mins to fix

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

                          def main():
                          args = parse_args()
                           
                          input_path, input_basename, path_base, output_dir = \
                          ssg.build_guides.get_path_args(args)
                          Severity: Minor
                          Found in build-scripts/build_all_guides.py - About 25 mins to fix

                          Function reorder_according_to_ordering has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring.
                          Open

                          def reorder_according_to_ordering(unordered, ordering, regex=None):
                          """
                          Reorders a list of items according to a specified ordering.
                           
                          Args:
                          Severity: Minor
                          Found in ssg/build_yaml.py - About 25 mins to fix

                          Function pretty has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring.
                          Open

                          def pretty(self, indent=0, debug=False):
                          """
                          Return a pretty formatted representation of self as an indented tree.
                           
                          If debug is True, also prints debug information for each expression arg.
                          Severity: Minor
                          Found in ssg/ext/boolean/boolean.py - About 25 mins to fix

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

                          def main():
                          args = parse_args()
                          product_yaml = os.path.join(args.ssg_root, "products", args.product, "product.yml")
                          if args.input_dir:
                          input_dir = args.input_dir
                          Severity: Minor
                          Found in build-scripts/build_rule_playbooks.py - About 25 mins to fix

                          Function _process_templated_tests has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring.
                          Open

                          def _process_templated_tests(env_yaml: Dict, rendered_rule_obj: Dict, templates_root: pathlib.Path,
                          rule_output_path: pathlib.Path):
                          logger = logging.getLogger()
                          rule_path = pathlib.Path(rendered_rule_obj['definition_location'])
                          product = rule_output_path.parent.parent.name
                          Severity: Minor
                          Found in build-scripts/build_tests.py - About 25 mins to fix

                          Function _get_rules_in_profile has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring.
                          Open

                          def _get_rules_in_profile(built_profiles_root) -> Generator[str, None, None]:
                          for profile_file in built_profiles_root.iterdir(): # type: pathlib.Path
                          if not profile_file.name.endswith(".profile"):
                          continue
                          profile_data = ssg.yaml.open_raw(str(profile_file.absolute()))
                          Severity: Minor
                          Found in build-scripts/build_tests.py - About 25 mins to fix

                          Function filter_rule_ids has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring.
                          Open

                          def filter_rule_ids(all_keys, queries):
                          """
                          Filters a set of keys based on a set of queries.
                           
                          A set of queries is a comma separated list of queries, where a query is either a rule id or
                          Severity: Minor
                          Found in ssg/rule_dir_stats.py - About 25 mins to fix

                          Function process_input_dict has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring.
                          Open

                          def process_input_dict(cls, input_contents, env_yaml, product_cpes=None):
                          """
                          Processes the input dictionary and updates it with additional data.
                           
                          Args:
                          Severity: Minor
                          Found in ssg/build_yaml.py - About 25 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language