<commit_before>---
title: Tutorial on McCabe and Halsted
layout: repopage
category: mccabehalsted
---

## McCabe

The McCabe metrics are a collection of four software metrics:

+ Cyclomatic complexity;
+ Essential complexity;
+ Design complexity;
+ Lines of Code (LOC).

Cyclomatic Complexity: a.k.a "v(G)", measures the number of "linearly
independent paths". A set of paths is said to be linearly independent
if no path in the set is a linear combination of any other paths
in the set through a program's "flowgraph". A flowgraph is a directed
graph where each node corresponds to a program statement, and each
arc indicates the flow of control from one statement to another.
"v(G)" is calculated by "v(G) = e - n + 2" where "G" is a program's<commit_msg>fixing typos<commit_after>---
title: Tutorial on McCabe and Halsted
layout: repo
category: mccabehalsted
---

## McCabe

The McCabe metrics are a collection of four software metrics:

+ Cyclomatic complexity;
+ Essential complexity;
+ Design complexity;
+ Lines of Code (LOC).

Cyclomatic Complexity: a.k.a "v(G)", measures the number of "linearly
independent paths". A set of paths is said to be linearly independent
if no path in the set is a linear combination of any other paths
in the set through a program's "flowgraph". A flowgraph is a directed
graph where each node corresponds to a program statement, and each
arc indicates the flow of control from one statement to another.
"v(G)" is calculated by "v(G) = e - n + 2" where "G" is a program's
{'fraction_non_alphanumeric': 0.07422133863485753, 'fraction_numerical': 0.0013253810470510272, 'mean_word_length': 4.392857142857143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3724027', 'n_tokens_mistral': 434, 'n_tokens_neox': 415, 'n_words': 228}