Skip to content
Open
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
90 changes: 30 additions & 60 deletions semgrep_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ def write_option(x: Any) -> Any:

@dataclass
class SupplyChainConfig:
"""Original type: supply_chain_config = { ... }
"""
"""Original type: supply_chain_config = { ... }"""

_rfu: Optional[int] = None

Expand Down Expand Up @@ -295,8 +294,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class Any_:
"""Original type: secrets_origin = [ ... | Any | ... ]
"""
"""Original type: secrets_origin = [ ... | Any | ... ]"""

@property
def kind(self) -> str:
Expand All @@ -313,8 +311,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class Semgrep:
"""Original type: secrets_origin = [ ... | Semgrep | ... ]
"""
"""Original type: secrets_origin = [ ... | Semgrep | ... ]"""

@property
def kind(self) -> str:
Expand All @@ -331,8 +328,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class NoCommunity:
"""Original type: secrets_origin = [ ... | NoCommunity | ... ]
"""
"""Original type: secrets_origin = [ ... | NoCommunity | ... ]"""

@property
def kind(self) -> str:
Expand All @@ -349,8 +345,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class SecretsOrigin:
"""Original type: secrets_origin = [ ... ]
"""
"""Original type: secrets_origin = [ ... ]"""

value: Union[Any_, Semgrep, NoCommunity]

Expand Down Expand Up @@ -384,8 +379,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class SecretsConfig:
"""Original type: secrets_config = { ... }
"""
"""Original type: secrets_config = { ... }"""

permitted_origins: SecretsOrigin

Expand Down Expand Up @@ -413,8 +407,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class ProFeatures:
"""Original type: pro_features = { ... }
"""
"""Original type: pro_features = { ... }"""

diffDepth: Optional[int] = None
numInterfileDiffScanned: Optional[List[Tuple[str, int]]] = None
Expand Down Expand Up @@ -447,8 +440,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class CodeConfig:
"""Original type: code_config = { ... }
"""
"""Original type: code_config = { ... }"""

_rfu: Optional[int] = None

Expand Down Expand Up @@ -477,8 +469,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class Intraprocedural:
"""Original type: analysis_type = [ ... | Intraprocedural | ... ]
"""
"""Original type: analysis_type = [ ... | Intraprocedural | ... ]"""

@property
def kind(self) -> str:
Expand All @@ -495,8 +486,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class Interprocedural:
"""Original type: analysis_type = [ ... | Interprocedural | ... ]
"""
"""Original type: analysis_type = [ ... | Interprocedural | ... ]"""

@property
def kind(self) -> str:
Expand All @@ -513,8 +503,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class Interfile:
"""Original type: analysis_type = [ ... | Interfile | ... ]
"""
"""Original type: analysis_type = [ ... | Interfile | ... ]"""

@property
def kind(self) -> str:
Expand All @@ -531,8 +520,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class AnalysisType:
"""Original type: analysis_type = [ ... ]
"""
"""Original type: analysis_type = [ ... ]"""

value: Union[Intraprocedural, Interprocedural, Interfile]

Expand Down Expand Up @@ -566,8 +554,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class EngineConfig:
"""Original type: engine_config = { ... }
"""
"""Original type: engine_config = { ... }"""

analysis_type: AnalysisType
pro_langs: bool
Expand Down Expand Up @@ -610,8 +597,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class Value:
"""Original type: value = { ... }
"""
"""Original type: value = { ... }"""

features: List[str]
proFeatures: Optional[ProFeatures] = None
Expand Down Expand Up @@ -670,8 +656,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class Uuid:
"""Original type: uuid
"""
"""Original type: uuid"""

value: str

Expand All @@ -692,8 +677,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class Sha256:
"""Original type: sha256
"""
"""Original type: sha256"""

value: str

Expand All @@ -714,8 +698,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class RuleStats:
"""Original type: rule_stats = { ... }
"""
"""Original type: rule_stats = { ... }"""

ruleHash: str
bytesScanned: int
Expand Down Expand Up @@ -750,8 +733,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class FileStats:
"""Original type: file_stats = { ... }
"""
"""Original type: file_stats = { ... }"""

size: int
numTimesScanned: int
Expand Down Expand Up @@ -794,8 +776,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class Performance:
"""Original type: performance = { ... }
"""
"""Original type: performance = { ... }"""

numRules: Optional[int] = None
numTargets: Optional[int] = None
Expand Down Expand Up @@ -848,8 +829,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class ParseStat:
"""Original type: parse_stat = { ... }
"""
"""Original type: parse_stat = { ... }"""

targets_parsed: int
num_targets: int
Expand Down Expand Up @@ -886,8 +866,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class Finding:
"""Original type: finding = { ... }
"""
"""Original type: finding = { ... }"""

path: str
line: int
Expand Down Expand Up @@ -927,8 +906,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class Mcp:
"""Original type: mcp = { ... }
"""
"""Original type: mcp = { ... }"""

deployment_name: Optional[str] = None
session_id: Optional[str] = None
Expand Down Expand Up @@ -1041,8 +1019,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class Guardian:
"""Original type: guardian = { ... }
"""
"""Original type: guardian = { ... }"""

hook: Optional[str] = None
session_id: Optional[str] = None
Expand Down Expand Up @@ -1139,8 +1116,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class Extension:
"""Original type: extension = { ... }
"""
"""Original type: extension = { ... }"""

machineId: Optional[str] = None
isNewAppInstall: Optional[bool] = None
Expand Down Expand Up @@ -1193,8 +1169,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class Error:
"""Original type: error
"""
"""Original type: error"""

value: str

Expand All @@ -1215,8 +1190,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class Errors:
"""Original type: errors = { ... }
"""
"""Original type: errors = { ... }"""

returnCode: Optional[int] = None
errors: Optional[List[Error]] = None
Expand Down Expand Up @@ -1249,8 +1223,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class Environment:
"""Original type: environment = { ... }
"""
"""Original type: environment = { ... }"""

version: str
os: str
Expand Down Expand Up @@ -1311,8 +1284,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class Datetime:
"""Original type: datetime
"""
"""Original type: datetime"""

value: str

Expand All @@ -1333,8 +1305,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class Payload:
"""Original type: payload = { ... }
"""
"""Original type: payload = { ... }"""

event_id: Uuid
started_at: Datetime
Expand Down Expand Up @@ -1395,8 +1366,7 @@ def to_json_string(self, **kw: Any) -> str:

@dataclass
class Lang:
"""Original type: lang
"""
"""Original type: lang"""

value: str

Expand Down
Loading