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

Methods

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 = "")

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)

Declared at: clang/include/clang/Analysis/CloneDetection.h:289

Parameters

std::vector<CloneDetector::CloneGroup>& CloneGroups