{% extends "base.html" %} {% block title %}Visualization - {{ result.get('filename', 'untitled') }} - Programming Visualization{% endblock %} {% block content %}
Time Complexity {{ result.get('complexity', {}).get('time', 'Unknown') }}
Space Complexity {{ result.get('complexity', {}).get('space', 'Unknown') }}
Analysis {{ result.get('complexity', {}).get('description', 'Analysis not available') }}

Code Composition

Function Complexity

Summary

Total Lines {{ result.get('total_lines', 0) }}
Code Lines {{ result.get('code_lines', 0) }}
Comments {{ result.get('comment_lines', 0) }}
Blank Lines {{ result.get('blank_lines', 0) }}
Functions {{ result.get('functions', [])|length }}
Classes {{ result.get('classes', [])|length }}
Imports {{ result.imports|length }}
Loops {{ result.get('loops', [])|length }}

Functions ({{ result.get('functions', [])|length }})

{% if result.functions %}
{% for func in result.get('functions', []) %}
{{ func.name }}() Line {{ func.line }}{% if func.get('end_line') %}-{{ func.get('end_line', func.get('line', '?')) }}{% endif %}
Parameters: {{ func.args|join(', ') or 'None' }}
{% if func.get('returns') %}
Returns: {{ func.get('returns', 'None') }}
{% endif %}
Complexity: {{ func.get('complexity', 1) }}
{% if func.get('calls') %}
Calls: {{ func.get('calls', [])|join(', ') }}
{% endif %} {% if func.get('docstring') %}
Docstring: {{ func.get('docstring', '') }}
{% endif %}
{% endfor %}
{% else %}

No functions found.

{% endif %}
{% if visualizations.function_hierarchy and not visualizations.function_hierarchy.error %}

Function Hierarchy

{% endif %}

Classes ({{ result.get('classes', [])|length }})

{% if result.classes %}
{% for cls in result.get('classes', []) %}
{{ cls.name }} Line {{ cls.line }}
{% if cls.get('bases') %}
Inherits: {{ cls.get('bases', [])|join(', ') }}
{% endif %} {% if cls.methods %}
Methods ({{ cls.get('methods', [])|length }}):
{% for method in cls.get('methods', []) %} {{ method.name }}() {% endfor %}
{% endif %} {% if cls.get('docstring') %}
{{ cls.get('docstring', '') }}
{% endif %}
{% endfor %}
{% else %}

No classes found.

{% endif %}
{% if visualizations.class_hierarchy and not visualizations.class_hierarchy.error %}

Class Hierarchy

{% endif %}
{% if visualizations.ast_tree and not visualizations.ast_tree.error %}

Abstract Syntax Tree

{% else %}

AST Visualization

AST visualization is only available for valid Python code.

{% endif %}
{% if visualizations.call_graph and not visualizations.call_graph.error %}

Function Call Graph

{% else %}

Call Graph

No function calls detected or not enough functions for a graph.

{% endif %}
{% if visualizations.flowchart and not visualizations.flowchart.error %}

Execution Flowchart

{% else %}

Execution Flowchart

{{ visualizations.flowchart.error if visualizations.flowchart else "No flow elements detected to generate flowchart." }}

{% endif %}
{% if visualizations.dependency_graph and not visualizations.dependency_graph.error %}

Dependency Graph

{% else %}

Dependencies

No imports/dependencies detected.

{% endif %} {% if result.get('imports') %}

Import List

{% for imp in result.get('imports', []) %} {{ imp }} {% endfor %}
{% endif %}
{% if result.get('function_explanations') %}

Function Explanations

{% for exp in result.get('function_explanations', []) %}
{{ exp.name }}() Complexity: {{ exp.complexity }}
Beginner

{{ exp.beginner }}

Intermediate

{{ exp.intermediate }}

Advanced

{{ exp.advanced }}

{% endfor %}
{% else %}

Explanations

No detailed explanations available for this analysis.

{% endif %}
{% if result.get('line_explanations') %}

Line-by-Line Breakdown

{% for line in result.get('line_explanations', []) %}
{{ line.line }}
{{ line.code }}
{{ line.purpose }} {{ line.explanation }} {% if line.variables %} Variables: {{ line.variables|join(', ') }} {% endif %}
{% endfor %}
{% else %}

Line by Line

No line-by-line breakdown available for this analysis.

{% endif %}

Download Report

{% endblock %} {% block scripts %} {% endblock %}