Generates a polar plot representing the security report based on the given data. Args: table (Table): The input data table containing security metrics. Returns: io.BytesIO: A buffer containing the generated plot image in PNG format. Returns an empty
(table: Table)
| 13 | |
| 14 | |
| 15 | def plot_security_report(table: Table) -> io.BytesIO: |
| 16 | """ |
| 17 | Generates a polar plot representing the security report based on the given data. |
| 18 | |
| 19 | Args: |
| 20 | table (Table): The input data table containing security metrics. |
| 21 | |
| 22 | Returns: |
| 23 | io.BytesIO: A buffer containing the generated plot image in PNG format. |
| 24 | Returns an empty buffer in case of an error. |
| 25 | """ |
| 26 | try: |
| 27 | return _plot_security_report(table=table) |
| 28 | except (TypeError, ValueError, OverflowError, IndexError, Exception) as e: |
| 29 | logger.error(f"Error in generating the security report: {e} {table}") |
| 30 | return io.BytesIO() |
| 31 | |
| 32 | |
| 33 | def generate_identifiers(data: pd.DataFrame) -> list[str]: |