Skip to content

Commit 4771ecd

Browse files
authored
Merge pull request #27 from OPPIDA/perf/module-loading
2 parents fbf4798 + 47dd7d2 commit 4771ecd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

codesectools/sasts/tools/Cppcheck/parser.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,19 @@
55
format used by CodeSecTools.
66
"""
77

8+
from __future__ import annotations
9+
810
import json
911
from pathlib import Path
10-
from typing import Self
12+
from typing import TYPE_CHECKING, Self
1113

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

18+
if TYPE_CHECKING:
19+
from lxml.etree import ElementTree
20+
1621

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

50-
from lxml.etree import ElementTree
51-
5255
def __init__(self, output_dir: Path, xml_tree: ElementTree, cmdout: dict) -> None:
5356
"""Initialize a CppcheckAnalysisResult instance.
5457

0 commit comments

Comments
 (0)