Code Duplication    Length = 12-12 lines in 2 locations

ssg/build_yaml.py 2 locations

@@ 764-775 (lines=12) @@
761
762
    GENERIC_FILENAME = "benchmark.yml"
763
764
    def load_entities(self, rules_by_id, values_by_id, groups_by_id):
765
        for rid, val in self.rules.items():
766
            if not val:
767
                self.rules[rid] = rules_by_id[rid]
768
769
        for vid, val in self.values.items():
770
            if not val:
771
                self.values[vid] = values_by_id[vid]
772
773
        for gid, val in self.groups.items():
774
            if not val:
775
                self.groups[gid] = groups_by_id[gid]
776
777
    @classmethod
778
    def process_input_dict(cls, input_contents, env_yaml):
@@ 998-1009 (lines=12) @@
995
                env_yaml["product_cpes"].cpe_platform_specification.add_platform(cpe_platform)
996
        return data
997
998
    def load_entities(self, rules_by_id, values_by_id, groups_by_id):
999
        for rid, val in self.rules.items():
1000
            if not val:
1001
                self.rules[rid] = rules_by_id[rid]
1002
1003
        for vid, val in self.values.items():
1004
            if not val:
1005
                self.values[vid] = values_by_id[vid]
1006
1007
        for gid, val in self.groups.items():
1008
            if not val:
1009
                self.groups[gid] = groups_by_id[gid]
1010
1011
    def represent_as_dict(self):
1012
        yaml_contents = super(Group, self).represent_as_dict()