35 static constexpr const char* TEMPLATE_RANDOM_ENTRY =
36 "Functions: {path_a} AND {path_b}. Similarity: {similarity} ";
39 double minimum_similarity;
40 double maximum_similarity;
41 double maximum_quantity;
43 const int seed = 123456789;
44 mt19937 rng = mt19937(seed);
51 bool is_valid_pair(tuple<double, Path, Path> path_pair);
57 vector<tuple<double, Path, Path>> get_similarity_pairs_filtered();
64 vector<tuple<double, Path, Path>> make_random_selection(vector<tuple<double, Path, Path>> path_pairs);
70 void print_path_pairs(vector<tuple<double, Path, Path>> path_pairs);
80 "Select random pairs of functions within a specified similarity range. "
81 "The provided MIN_SIMILARITY and MAX_SIMILARITY parameters define the "
82 "inclusive similarity interval, and up to MAX_QUANTITY pairs are randomly "
83 "selected and displayed.")
const CliOption * options() const final
Random pair selector for similar code segments.
bool validate(const ParsedOptions &options) override
Validate the arguments already analyzed.
bool run(const ParsedOptions &options) override
Handles random selection command.
static constexpr CliOption options_[]
COMMAND_DESCRIPTION("Select random pairs of functions within a specified similarity range. " "The provided MIN_SIMILARITY and MAX_SIMILARITY parameters define the " "inclusive similarity interval, and up to MAX_QUANTITY pairs are randomly " "selected and displayed.") explicit RandomSelector(Similarity_Table *_similarity_table)
Constructs selector with configuration.
Represents a similarity graph between functions (paths).
#define OPTION_END
This marks the end of a long array of options.
Path abstraction for temporary codebase.
Similarity relationships storage and analysis.
Defines utility functions used across all files.