class MinComplexityConstraint
Declaration
class MinComplexityConstraint { /* full declaration omitted */ };
Description
Ensures that every clone has at least the given complexity. Complexity is here defined as the total amount of children of a statement. This constraint assumes the first statement in the group is representative for all other statements in the group in terms of complexity.
Declared at: clang/include/clang/Analysis/CloneDetection.h:275
Member Variables
- private unsigned int MinComplexity
Method Overview
- public MinComplexityConstraint(unsigned int MinComplexity)
- public size_t calculateStmtComplexity(const clang::StmtSequence & Seq, std::size_t Limit, const std::string & ParentMacroStack = "")
- public void constrain(std::vector<CloneDetector::CloneGroup> & CloneGroups)
Methods
¶MinComplexityConstraint(
unsigned int MinComplexity)
MinComplexityConstraint(
unsigned int MinComplexity)
Declared at: clang/include/clang/Analysis/CloneDetection.h:279
Parameters
- unsigned int MinComplexity
¶size_t calculateStmtComplexity(
const clang::StmtSequence& Seq,
std::size_t Limit,
const std::string& ParentMacroStack = "")
size_t calculateStmtComplexity(
const clang::StmtSequence& Seq,
std::size_t Limit,
const std::string& ParentMacroStack = "")
Description
Calculates the complexity of the given StmtSequence.
Declared at: clang/include/clang/Analysis/CloneDetection.h:286
Parameters
- const clang::StmtSequence& Seq
- std::size_t Limit
- The limit of complexity we probe for. After reaching this limit during calculation, this method is exiting early to improve performance and returns this limit.
- const std::string& ParentMacroStack = ""
¶void constrain(
std::vector<CloneDetector::CloneGroup>&
CloneGroups)
void constrain(
std::vector<CloneDetector::CloneGroup>&
CloneGroups)
Declared at: clang/include/clang/Analysis/CloneDetection.h:289
Parameters
- std::vector<CloneDetector::CloneGroup>& CloneGroups