Code Duplication    Length = 13-14 lines in 2 locations

oval_graph/client.py 1 location

@@ 150-163 (lines=14) @@
147
            self._get_wanted_rules_from_array_of_IDs(
148
                self.xml_parser.notselected_rules))
149
150
    def _check_rules_id(self, rules, notselected_rules):
151
        if len(notselected_rules) and not rules:
152
            raise ValueError(
153
                ('Rule(s) "{}" was not selected, '
154
                 "so there are no results. The rule is"
155
                 ' "notselected" because it'
156
                 " wasn't a part of the executed profile"
157
                 " and therefore it wasn't evaluated "
158
                 "during the scan.")
159
                .format(notselected_rules))
160
        elif not notselected_rules and not rules:
161
            raise ValueError('404 rule "{}" not found!'.format(self.rule_name))
162
        else:
163
            return rules
164
165
    def get_save_src(self, rule):
166
        if self.out is not None:

oval_graph/command_line_client/client.py 1 location

@@ 120-132 (lines=13) @@
117
            x for x in rules if re.search(
118
                self.rule_name, x)]
119
120
    def _check_rules_id(self, rules, notselected_rules):
121
        if notselected_rules and not rules:
122
            raise ValueError(
123
                ('Rule(s) "{}" was not selected, '
124
                 "so there are no results. The rule is"
125
                 ' "notselected" because it'
126
                 " wasn't a part of the executed profile"
127
                 " and therefore it wasn't evaluated "
128
                 "during the scan.")
129
                .format(notselected_rules))
130
        if not notselected_rules and not rules:
131
            raise ValueError('404 rule "{}" not found!'.format(self.rule_name))
132
        return rules
133
134
    # Function for setting arguments
135