1919# VARIABLES #
2020
2121# Define the output directory:
22- JAVASCRIPT_COMPLEXITY_DIR ?= $(COMPLEXITY_DIR ) /javascript
22+ JAVASCRIPT_COMPLEXITY_OUT ?= $(COMPLEXITY_DIR ) /javascript
2323
2424
2525# DEPENDENCIES #
@@ -31,93 +31,145 @@ endif
3131
3232# RULES #
3333
34- # Analyze code complexity.
35- #
36- # This target analyzes all JavaScript source code.
34+ # /
35+ # Analyzes code complexity for all JavaScript code.
3736#
3837# TODO: address bash argument length errors
39-
38+ #
39+ # @param {string} [JAVASCRIPT_COMPLEXITY_OUT] - output directory
40+ #
41+ # @example
42+ # make complexity-javascript
43+ #
44+ # @example
45+ # make complexity-javascript JAVASCRIPT_COMPLEXITY_OUT=/foo/bar/beep/boop
46+ # /
4047complexity-javascript : $(NODE_MODULES )
4148 $(QUIET ) $(JAVASCRIPT_COMPLEXITY ) $(JAVASCRIPT_COMPLEXITY_FLAGS ) $(SOURCES ) $(TESTS ) $(EXAMPLES ) $(BENCHMARKS )
4249
4350.PHONY : complexity-javascript
4451
45-
46- # Analyze source code complexity.
47- #
48- # This target analyzes only JavaScript source files.
52+ # /
53+ # Analyzes code complexity for JavaScript source code.
4954#
5055# TODO: address bash argument length errors
51-
56+ #
57+ # @param {string} [JAVASCRIPT_COMPLEXITY_OUT] - output directory
58+ #
59+ # @example
60+ # make complexity-javascript-src
61+ #
62+ # @example
63+ # make complexity-javascript-src JAVASCRIPT_COMPLEXITY_OUT=/foo/bar/beep/boop
64+ # /
5265complexity-javascript-src : $(NODE_MODULES )
5366 $(QUIET ) $(JAVASCRIPT_COMPLEXITY ) $(JAVASCRIPT_COMPLEXITY_FLAGS ) $(SOURCES )
5467
5568.PHONY : complexity-javascript-src
5669
57-
58- # Analyze test code complexity.
59- #
60- # This target analyzes only JavaScript test files.
70+ # /
71+ # Analyzes code complexity for JavaScript test files.
6172#
6273# TODO: address bash argument length errors
63-
74+ #
75+ # @param {string} [JAVASCRIPT_COMPLEXITY_OUT] - output directory
76+ #
77+ # @example
78+ # make complexity-javascript-tests
79+ #
80+ # @example
81+ # make complexity-javascript-tests JAVASCRIPT_COMPLEXITY_OUT=/foo/bar/beep/boop
82+ # /
6483complexity-javascript-tests : $(NODE_MODULES )
6584 $(QUIET ) $(JAVASCRIPT_COMPLEXITY ) $(JAVASCRIPT_COMPLEXITY_FLAGS ) $(TESTS )
6685
6786.PHONY : complexity-javascript-tests
6887
69-
70- # Analyze example code complexity.
71- #
72- # This target analyzes only JavaScript example files.
88+ # /
89+ # Analyzes code complexity for JavaScript example files.
7390#
7491# TODO: address bash argument length errors
75-
92+ #
93+ # @param {string} [JAVASCRIPT_COMPLEXITY_OUT] - output directory
94+ #
95+ # @example
96+ # make complexity-javascript-examples
97+ #
98+ # @example
99+ # make complexity-javascript-examples JAVASCRIPT_COMPLEXITY_OUT=/foo/bar/beep/boop
100+ # /
76101complexity-javascript-examples : $(NODE_MODULES )
77102 $(QUIET ) $(JAVASCRIPT_COMPLEXITY ) $(JAVASCRIPT_COMPLEXITY_FLAGS ) $(EXAMPLES )
78103
79104.PHONY : complexity-javascript-examples
80105
81-
82- # Analyze benchmark code complexity.
83- #
84- # This target analyzes only JavaScript benchmark files.
106+ # /
107+ # Analyzes code complexity for JavaScript benchmark files.
85108#
86109# TODO: address bash argument length errors
87-
110+ #
111+ # @param {string} [JAVASCRIPT_COMPLEXITY_OUT] - output directory
112+ #
113+ # @example
114+ # make complexity-javascript-benchmarks
115+ #
116+ # @example
117+ # make complexity-javascript-benchmarks JAVASCRIPT_COMPLEXITY_OUT=/foo/bar/beep/boop
118+ # /
88119complexity-javascript-benchmarks : $(NODE_MODULES )
89120 $(QUIET ) $(JAVASCRIPT_COMPLEXITY ) $(JAVASCRIPT_COMPLEXITY_FLAGS ) $(BENCHMARKS )
90121
91122.PHONY : complexity-javascript-benchmarks
92123
93-
94- # Analyze code complexity.
124+ # /
125+ # Analyzes code complexity for a list of JavaScript files .
95126#
96- # This target analyzes JavaScript code complexity. Note that we expect `$FILES` to be a JavaScript file list.
97-
127+ # TODO: address bash argument length errors
128+ #
129+ # @param {string} FILES - list of JavaScript file paths
130+ # @param {string} [JAVASCRIPT_COMPLEXITY_OUT] - output directory
131+ #
132+ # @example
133+ # make complexity-javascript-files FILES='/foo/bar.js /beep/boop.js'
134+ #
135+ # @example
136+ # make complexity-javascript-files FILES='/foo/bar.js /beep/boop.js' JAVASCRIPT_COMPLEXITY_OUT=/foo/bar/beep/boop
137+ # /
98138complexity-javascript-files : $(NODE_MODULES )
99139 $(QUIET ) $(JAVASCRIPT_COMPLEXITY ) $(JAVASCRIPT_COMPLEXITY_FLAGS ) $(FILES )
100140
101141.PHONY : complexity-javascript-files
102142
103-
104- # View a complexity report.
143+ # /
144+ # Opens an HTML JavaScript complexity report in a local web browser .
105145#
106- # This target opens an HTML JavaScript complexity report in a local web browser.
107-
146+ # @param {string} [JAVASCRIPT_COMPLEXITY_OUT] - output directory containing an HTML JavaScript complexity report
147+ #
148+ # @example
149+ # make view-javascript-complexity
150+ #
151+ # @example
152+ # make view-javascript-complexity JAVASCRIPT_COMPLEXITY_OUT=/foo/bar/beep/boop
153+ # /
108154view-javascript-complexity :
109155ifeq ($(JAVASCRIPT_COMPLEXITY_TOOL ) , plato)
110156 $(QUIET) $(MAKE) -f $(this_file) view-plato-report
111157endif
112158
113159.PHONY : view-javascript-complexity
114160
115-
116- # Remove a complexity directory.
161+ # /
162+ # Removes an output complexity directory.
117163#
118- # This target cleans up a JavaScript complexity directory by removing it entirely.
119-
164+ # @param {string} [JAVASCRIPT_COMPLEXITY_OUT] - output directory to be removed
165+ #
166+ # @example
167+ # make clean-javascript-complexity
168+ #
169+ # @example
170+ # make clean-javascript-complexity JAVASCRIPT_COMPLEXITY_OUT=/foo/bar/beep/boop
171+ # /
120172clean-javascript-complexity :
121- $(QUIET ) $(DELETE ) $(DELETE_FLAGS ) $(JAVASCRIPT_COMPLEXITY_DIR )
173+ $(QUIET ) $(DELETE ) $(DELETE_FLAGS ) $(JAVASCRIPT_COMPLEXITY_OUT )
122174
123175.PHONY : clean-javascript-complexity
0 commit comments