sec_interp.analyze_project_optfixed module

analyze_project_opt2.py - Analiza estructura del proyecto para IA Versión optimizada con mejoras de rendimiento y funcionalidad.

exception sec_interp.analyze_project_optfixed.TimeoutException

Bases: Exception

Excepción para timeouts.

exception sec_interp.analyze_project_optfixed.AnalysisError

Bases: Exception

Excepción base para errores de análisis.

sec_interp.analyze_project_optfixed.timeout(seconds: int)

Context manager para timeout de operaciones.

class sec_interp.analyze_project_optfixed.LRUCache(maxsize: int = 256)

Bases: object

Cache LRU más eficiente que lru_cache para grandes volúmenes.

get(key: str) Any

Obtener valor del cache.

set(key: str, value: Any) None

Establecer valor en cache.

clear() None

Limpiar cache.

stats() dict[str, Any]

Obtener estadísticas del cache.

class sec_interp.analyze_project_optfixed.ProgressTracker(total_files: int)

Bases: object

Tracker de progreso con estadísticas en tiempo real.

update(file_path: Path, processing_time: float) None

Actualizar progreso.

complete() dict[str, Any]

Completar tracker y retornar estadísticas.

class sec_interp.analyze_project_optfixed.ModuleAnalysis(name: str, lines: int, functions: list[str], classes: list[str], imports: list[str], complexity_score: float, dependencies: list[str], todo_comments: list[str])

Bases: object

Análisis de un módulo Python.

name: str
lines: int
functions: list[str]
classes: list[str]
imports: list[str]
complexity_score: float
dependencies: list[str]
todo_comments: list[str]
class sec_interp.analyze_project_optfixed.ProjectContext(project_name: str, structure: dict[str, Any], entry_points: list[str], tech_stack: dict[str, list[str]], patterns: dict[str, Any], technical_debt: list[str], optimization_opportunities: list[str], security_issues: list[str])

Bases: object

Contexto completo del proyecto.

project_name: str
structure: dict[str, Any]
entry_points: list[str]
tech_stack: dict[str, list[str]]
patterns: dict[str, Any]
technical_debt: list[str]
optimization_opportunities: list[str]
security_issues: list[str]
class sec_interp.analyze_project_optfixed.ProjectAnalyzer(project_path: str, max_workers: int | None = None, exclude_patterns: list[str] | None = None)

Bases: object

DEFAULT_CONFIG = {'qgis_weights': {'mandatory_files': 5, 'metadata_valid': 4, 'qgis_widget_usage': 2, 'spatial_index_usage': 3, 'ui_logic_separation': 4}, 'quality_weights': {'complexity_high': 1, 'complexity_low': 3, 'complexity_medium': 2, 'docstrings': 3, 'has_main': 1, 'no_syntax_error': 1, 'size_medium': 1, 'size_small': 2}, 'thresholds': {'complexity_high': 15, 'complexity_low': 5, 'complexity_medium': 10, 'size_medium': 400, 'size_small': 200}}
analyze() dict[str, Any]

Ejecuta análisis completo optimizado.

sec_interp.analyze_project_optfixed.setup_logging(verbose: bool = False)

Configura el sistema de logging.

sec_interp.analyze_project_optfixed.main()

Función principal optimizada.