<commit_before>
# VARIABLES #

# Define the analysis tool to use when analyzing JavaScript files:
JAVASCRIPT_COMPLEXITY_TOOL ?= plato

# Define the output directory:
JAVASCRIPT_COMPLEXITY_DIR ?= $(COMPLEXITY_DIR)/javascript


# DEPENDENCIES #

ifeq ($(JAVASCRIPT_COMPLEXITY_TOOL), plato)
	include $(TOOLS_MAKE_LIB_DIR)/complexity/plato.mk
endif


# TARGETS #

# Analyze code complexity.
#
# This target analyzes all JavaScript source code.

complexity-javascript: $(NODE_MODULES)
	$(QUIET) $(JAVASCRIPT_COMPLEXITY) $(JAVASCRIPT_COMPLEXITY_FLAGS) $(SOURCES) $(TESTS) $(EXAMPLES)

.PHONY: complexity-javascript


# Analyze source code complexity.
#
# This target analyzes only JavaScript source files.

complexity-javascript-src: $(NODE_MODULES)
	$(QUIET) $(JAVASCRIPT_COMPLEXITY) $(JAVASCRIPT_COMPLEXITY_FLAGS) $(SOURCES)

.PHONY: complexity-javascript-src


# Analyze test code complexity.
#
# This target analyzes only JavaScript test files.

complexity-javascript-tests: $(NODE_MODULES)
	$(QUIET) $(JAVASCRIPT_COMPLEXITY) $(JAVASCRIPT_COMPLEXITY_FLAGS) $(TESTS)

.PHONY: complexity-javascript-tests


# Analyze example code complexity.
#
# This target analyzes only JavaScript example files.

complexity-javascript-examples: $(NODE_MODULES)
	$(QUIET) $(JAVASCRIPT_COMPLEXITY) $(JAVASCRIPT_COMPLEXITY_FLAGS) $(EXAMPLES)

.PHONY: complexity-javascript-examples


# View a complexity report.
#
# This target opens an HTML JavaScript complexity report in a local web browser.

view-javascript-complexity:
ifeq ($(JAVASCRIPT_COMPLEXITY_TOOL), plato)
	$(QUIET) $(MAKE) -f $(this_file) view-plato-report
endif

.PHONY: view-javascript-complexity


# Remove a complexity directory.
#
# This target cleans up a JavaScript complexity directory by removing it entirely.

clean-javascript-complexity:
	$(QUIET) $(DELETE) $(DELETE_FLAGS) $(JAVASCRIPT_COMPLEXITY_DIR)

.PHONY: clean-javascript-complexity
<commit_msg>Add recipe to generating a complexity report for benchmark files<commit_after>
# VARIABLES #

# Define the analysis tool to use when analyzing JavaScript files:
JAVASCRIPT_COMPLEXITY_TOOL ?= plato

# Define the output directory:
JAVASCRIPT_COMPLEXITY_DIR ?= $(COMPLEXITY_DIR)/javascript


# DEPENDENCIES #

ifeq ($(JAVASCRIPT_COMPLEXITY_TOOL), plato)
	include $(TOOLS_MAKE_LIB_DIR)/complexity/plato.mk
endif


# TARGETS #

# Analyze code complexity.
#
# This target analyzes all JavaScript source code.

complexity-javascript: $(NODE_MODULES)
	$(QUIET) $(JAVASCRIPT_COMPLEXITY) $(JAVASCRIPT_COMPLEXITY_FLAGS) $(SOURCES) $(TESTS) $(EXAMPLES) $(BENCHMARKS)

.PHONY: complexity-javascript


# Analyze source code complexity.
#
# This target analyzes only JavaScript source files.

complexity-javascript-src: $(NODE_MODULES)
	$(QUIET) $(JAVASCRIPT_COMPLEXITY) $(JAVASCRIPT_COMPLEXITY_FLAGS) $(SOURCES)

.PHONY: complexity-javascript-src


# Analyze test code complexity.
#
# This target analyzes only JavaScript test files.

complexity-javascript-tests: $(NODE_MODULES)
	$(QUIET) $(JAVASCRIPT_COMPLEXITY) $(JAVASCRIPT_COMPLEXITY_FLAGS) $(TESTS)

.PHONY: complexity-javascript-tests


# Analyze example code complexity.
#
# This target analyzes only JavaScript example files.

complexity-javascript-examples: $(NODE_MODULES)
	$(QUIET) $(JAVASCRIPT_COMPLEXITY) $(JAVASCRIPT_COMPLEXITY_FLAGS) $(EXAMPLES)

.PHONY: complexity-javascript-examples


# Analyze benchmark code complexity.
#
# This target analyzes only JavaScript benchmark files.

complexity-javascript-benchmarks: $(NODE_MODULES)
	$(QUIET) $(JAVASCRIPT_COMPLEXITY) $(JAVASCRIPT_COMPLEXITY_FLAGS) $(BENCHMARKS)

.PHONY: complexity-javascript-benchmarks


# View a complexity report.
#
# This target opens an HTML JavaScript complexity report in a local web browser.

view-javascript-complexity:
ifeq ($(JAVASCRIPT_COMPLEXITY_TOOL), plato)
	$(QUIET) $(MAKE) -f $(this_file) view-plato-report
endif

.PHONY: view-javascript-complexity


# Remove a complexity directory.
#
# This target cleans up a JavaScript complexity directory by removing it entirely.

clean-javascript-complexity:
	$(QUIET) $(DELETE) $(DELETE_FLAGS) $(JAVASCRIPT_COMPLEXITY_DIR)

.PHONY: clean-javascript-complexity

{'fraction_non_alphanumeric': 0.10325693606755126, 'fraction_numerical': 0.0, 'mean_word_length': 6.111492281303602, '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': '2258798', 'n_tokens_mistral': 1507, 'n_tokens_neox': 1406, 'n_words': 343}