Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions codesectools/sasts/tools/Cppcheck/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@
format used by CodeSecTools.
"""

from __future__ import annotations

import json
from pathlib import Path
from typing import Self
from typing import TYPE_CHECKING, Self

from codesectools.sasts.core.parser import AnalysisResult, Defect
from codesectools.shared.cwe import CWE, CWEs
from codesectools.utils import MissingFile

if TYPE_CHECKING:
from lxml.etree import ElementTree


class CppcheckError(Defect):
"""Represent a single error reported by Cppcheck."""
Expand Down Expand Up @@ -47,8 +52,6 @@ def __init__(
class CppcheckAnalysisResult(AnalysisResult):
"""Represent the complete result of a Cppcheck analysis."""

from lxml.etree import ElementTree

def __init__(self, output_dir: Path, xml_tree: ElementTree, cmdout: dict) -> None:
"""Initialize a CppcheckAnalysisResult instance.

Expand Down