diff --git a/examples/CodeMetric/Analyse.cpp b/examples/CodeMetric/Analyse.cpp index 66e8c406e..971acafb8 100644 --- a/examples/CodeMetric/Analyse.cpp +++ b/examples/CodeMetric/Analyse.cpp @@ -81,22 +81,22 @@ void CodeMetric::StoreError(int line, const String &msg) int CodeMetric::LogicalLinesOfCode(const LexSymbolStat &symbolStat) { - static Vector oneLiners( + static Vector oneLiners(pick( Vector() << tk_if << tk_else << tk_switch << tk_case << tk_for << tk_do << tk_while << tk_try << tk_catch << tk_struct << tk_class << tk_namespace << tk_public << tk_private << tk_protected - << ';'); + << ';')); return symbolStat.SumStat( oneLiners ); } void CodeMetric::StoreMetric(const Parser::FunctionStat & functionStat) { - static Vector cc1_symbols( - Vector() << tk_if << tk_case << tk_for << tk_while << tk_catch); + static Vector cc1_symbols(pick( + Vector() << tk_if << tk_case << tk_for << tk_while << tk_catch)); - static Vector cc2_symbols( - Vector() << t_and << t_or << '?'); + static Vector cc2_symbols(pick( + Vector() << t_and << t_or << '?')); if(!functionStat.cppItem.impl) return; diff --git a/examples/CodeMetric/CodeMetric.upp b/examples/CodeMetric/CodeMetric.upp index 819be53a3..c05976388 100644 --- a/examples/CodeMetric/CodeMetric.upp +++ b/examples/CodeMetric/CodeMetric.upp @@ -1,4 +1,4 @@ -description "Investigating C++ cyclometric complexity"; +description "Investigating C++ cyclometric complexity\377"; uses CtrlLib, diff --git a/examples/CodeMetric/init b/examples/CodeMetric/init new file mode 100644 index 000000000..a6429cb19 --- /dev/null +++ b/examples/CodeMetric/init @@ -0,0 +1,5 @@ +#ifndef _CodeMetric_icpp_init_stub +#define _CodeMetric_icpp_init_stub +#include "CtrlLib/init" +#include "CppBase/init" +#endif