Skip to documentation
SLOP

tiny.smg.scan.core.count

Reference tiny.smg scan core count

Defined in scan.core.

API (3)

Actions

Public operations.

No direct callersNo direct callsscan.corecount
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Called byCallsprivate; no linktools.smg.src.scan.pipeline.scanfinishScanFileprivate; no linktools.smg.src.scan.core.countcountscan.core.countcountLang
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsprivate; no linktools.smg.src.scan.pipeline.scanaddCDefineConstantNodeprivate; no linktools.smg.src.scan.pipeline.scanaddCLikeFunctionNodeprivate; no linktools.smg.src.scan.pipeline.scanaddCLikeNamespaceNodeprivate; no linktools.smg.src.scan.pipeline.scanaddCLikeRecordNodeprivate; no linktools.smg.src.scan.pipeline.scanaddScanFileModule+10 moreprivate; no linktools.smg.src.scan.core.countcountscan.core.countcountType
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsprivate; no linktools.smg.src.scan.pipeline.scanresolveDeferredEdgesprivate; no linktools.smg.src.scan.core.countcountscan.core.countrecordSkipped
Static calls · unresolved targets: 1 · external targets: 0.

Source: tools/smg/src/scan/core/count.zig

zig
const std = @import("std");const smg = @import("../../root.zig");const core = @import("root.zig");const model = smg.model;const Count = core.Count;const SkippedEdgeSample = core.SkippedEdgeSample;const Stats = core.Stats;fn count(items: *std.ArrayList(Count), allocator: std.mem.Allocator, name: []const u8) !void {    for (items.items) |*item| {        if (std.mem.eql(u8, item.name, name)) {            item.count += 1;            return;        }    }    try items.append(allocator, .{ .name = try allocator.dupe(u8, name), .count = 1 });}pub fn countLang(stats: *Stats, allocator: std.mem.Allocator, name: []const u8) !void {    try count(&stats.lang_counts, allocator, name);}pub fn countType(stats: *Stats, allocator: std.mem.Allocator, name: []const u8) !void {    try count(&stats.type_counts, allocator, name);}pub fn recordSkipped(stats: *Stats, allocator: std.mem.Allocator, edge: model.Edge, reason: []const u8, category: []const u8) !void {    stats.skipped_edges += 1;    try count(&stats.skipped_edge_categories, allocator, category);    const sample = SkippedEdgeSample{        .source = edge.source,        .rel = edge.rel,        .target = edge.target,        .reason = reason,        .category = category,    };    for (stats.skipped_edge_samples.items) |existing| {        if (std.mem.eql(u8, existing.source, sample.source) and            std.mem.eql(u8, existing.rel, sample.rel) and            std.mem.eql(u8, existing.target, sample.target) and            std.mem.eql(u8, existing.reason, sample.reason) and            std.mem.eql(u8, existing.category, sample.category)) return;    }    if (stats.skipped_edge_samples.items.len < 10) try stats.skipped_edge_samples.append(allocator, sample);}

Source: tools/smg/src/scan/core/root.zig:1

zig
pub const count = @import("count.zig");

Complete caller list for scan.core.count.countType

15 direct callers.

Audit

Definitions4
Public names7
Members0
Version26.7.0
Revisiondaab053ee433