Code Duplication    Length = 41-42 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 2 locations

@@ 5184-5225 (lines=42) @@
5181
5182
        return self._send_xml_command(cmd)
5183
5184
    def get_reports(
5185
        self,
5186
        *,
5187
        filter: Optional[str] = None,
5188
        filter_id: Optional[str] = None,
5189
        note_details: Optional[bool] = None,
5190
        override_details: Optional[bool] = None,
5191
        details: Optional[bool] = None,
5192
    ) -> Any:
5193
        """Request a list of reports
5194
5195
        Arguments:
5196
            filter: Filter term to use for the query
5197
            filter_id: UUID of an existing filter to use for the query
5198
            note_details: If notes are included, whether to include note details
5199
            override_details: If overrides are included, whether to include
5200
                override details
5201
            details: Whether to exclude results
5202
5203
        Returns:
5204
            The response. See :py:meth:`send_command` for details.
5205
        """
5206
        cmd = XmlCommand("get_reports")
5207
5208
        if filter:
5209
            cmd.set_attribute("report_filter", filter)
5210
5211
        if filter_id:
5212
            cmd.set_attribute("report_filt_id", filter_id)
5213
5214
        if note_details is not None:
5215
            cmd.set_attribute("note_details", to_bool(note_details))
5216
5217
        if override_details is not None:
5218
            cmd.set_attribute("override_details", to_bool(override_details))
5219
5220
        if details is not None:
5221
            cmd.set_attribute("details", to_bool(details))
5222
5223
        cmd.set_attribute("ignore_pagination", "1")
5224
5225
        return self._send_xml_command(cmd)
5226
5227
    def get_report(
5228
        self,
@@ 5352-5392 (lines=41) @@
5349
        cmd.set_attribute("details", "1")
5350
        return self._send_xml_command(cmd)
5351
5352
    def get_results(
5353
        self,
5354
        *,
5355
        filter: Optional[str] = None,
5356
        filter_id: Optional[str] = None,
5357
        task_id: Optional[str] = None,
5358
        note_details: Optional[bool] = None,
5359
        override_details: Optional[bool] = None,
5360
        details: Optional[bool] = None,
5361
    ) -> Any:
5362
        """Request a list of results
5363
5364
        Arguments:
5365
            filter: Filter term to use for the query
5366
            filter_id: UUID of an existing filter to use for the query
5367
            task_id: UUID of task for note and override handling
5368
            note_details: If notes are included, whether to include note details
5369
            override_details: If overrides are included, whether to include
5370
                override details
5371
            details: Whether to include additional details of the results
5372
5373
        Returns:
5374
            The response. See :py:meth:`send_command` for details.
5375
        """
5376
        cmd = XmlCommand("get_results")
5377
5378
        add_filter(cmd, filter, filter_id)
5379
5380
        if task_id:
5381
            cmd.set_attribute("task_id", task_id)
5382
5383
        if details is not None:
5384
            cmd.set_attribute("details", to_bool(details))
5385
5386
        if note_details is not None:
5387
            cmd.set_attribute("note_details", to_bool(note_details))
5388
5389
        if override_details is not None:
5390
            cmd.set_attribute("override_details", to_bool(override_details))
5391
5392
        return self._send_xml_command(cmd)
5393
5394
    def get_result(self, result_id: str) -> Any:
5395
        """Request a single result