MCPcopy
hub / github.com/msoedov/agentic_security / plot_security_report

Function plot_security_report

agentic_security/report_chart.py:15–30  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

13
14
15def 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
33def generate_identifiers(data: pd.DataFrame) -> list[str]:

Callers 6

test_returns_bytesioMethod · 0.90
test_multiple_modulesMethod · 0.90
get_plotFunction · 0.85

Calls 2

_plot_security_reportFunction · 0.85
errorMethod · 0.80

Tested by 5

test_returns_bytesioMethod · 0.72
test_multiple_modulesMethod · 0.72