src/project.js |
- |
128 |
require returns object
|
- |
|
analyze function is exported
|
- |
|
process function is exported
|
- |
|
analyzeAsync function is exported
|
- |
|
processAsync function is exported
|
- |
|
analyze throws when modules is object
|
- |
|
analyze does not throw when modules is array
|
- |
|
analyzeAsync does not throw when modules is array
|
- |
|
analyze throws when modules is not an array
|
- |
|
analyze throws when srcPath is missing
|
- |
|
no modules:
|
- |
13 |
object was returned
|
- |
|
modules array exists
|
- |
|
modules array has zero length
|
- |
|
adjacency list exists
|
- |
|
adjacency list has zero length
|
- |
|
first-order density is correct
|
- |
|
change cost is correct
|
- |
|
core size is correct
|
- |
|
mean per-function logical LOC is correct
|
- |
|
mean per-function cyclomatic complexity is correct
|
- |
|
mean per-function Halstead effort is correct
|
- |
|
mean per-function parameter count is correct
|
- |
|
mean per-function maintainability index is correct
|
- |
|
one module:
|
- |
28 |
modules is correct length
|
- |
|
first module methodAggregate has correct physical lines of code
|
- |
|
first module methodAggregate has correct logical lines of code
|
- |
|
first module methodAggregate has correct cyclomatic complexity
|
- |
|
first module methodAggregate has correct cyclomatic complexity density
|
- |
|
first module methods is empty
|
- |
|
first module methodAggregate has correct Halstead total operators
|
- |
|
first module methodAggregate has correct Halstead distinct operators
|
- |
|
first module methodAggregate has correct Halstead total operands
|
- |
|
first module methodAggregate has correct Halstead distinct operands
|
- |
|
first module methodAggregate has correct Halstead operator identifier length
|
- |
|
first module methodAggregate has correct Halstead operand identifier length
|
- |
|
first module methodAggregate has correct Halstead length
|
- |
|
first module methodAggregate has correct Halstead vocabulary
|
- |
|
first module methodAggregate has correct Halstead difficulty
|
- |
|
first module methodAggregate has correct Halstead volume
|
- |
|
first module methodAggregate has correct Halstead effort
|
- |
|
first module methodAggregate has correct Halstead bugs
|
- |
|
first module methodAggregate has correct Halstead time
|
- |
|
first module has correct srcPath
|
- |
|
first-order density is correct
|
- |
|
change cost is correct
|
- |
|
core size is correct
|
- |
|
mean per-function logical LOC is correct
|
- |
|
mean per-function cyclomatic complexity is correct
|
- |
|
mean per-function Halstead effort is correct
|
- |
|
mean per-function parameter count is correct
|
- |
|
mean per-function maintainability index is correct
|
- |
|
two modules:
|
- |
34 |
modules is correct length
|
- |
|
first module methodAggregate has correct physical lines of code
|
- |
|
first module methodAggregate has correct logical lines of code
|
- |
|
first module methodAggregate has correct cyclomatic complexity
|
- |
|
first module methodAggregate has correct cyclomatic complexity density
|
- |
|
first module methods is empty
|
- |
|
first module methodAggregate has correct Halstead total operators
|
- |
|
first module methodAggregate has correct Halstead distinct operators
|
- |
|
first module methodAggregate has correct Halstead total operands
|
- |
|
first module methodAggregate has correct Halstead distinct operands
|
- |
|
first module methodAggregate has correct Halstead operator identifier length
|
- |
|
first module methodAggregate has correct Halstead operand identifier length
|
- |
|
first module methodAggregate has correct Halstead length
|
- |
|
first module methodAggregate has correct Halstead vocabulary
|
- |
|
first module methodAggregate has correct Halstead difficulty
|
- |
|
first module methodAggregate has correct Halstead volume
|
- |
|
first module methodAggregate has correct Halstead effort
|
- |
|
first module methodAggregate has correct Halstead bugs
|
- |
|
first module methodAggregate has correct Halstead time
|
- |
|
first module has correct srcPath
|
- |
|
second module maintainability index is correct
|
- |
|
second module first method has correct parameter count
|
- |
|
second module second method has correct parameter count
|
- |
|
second module methodAggregate has correct parameter count
|
- |
|
second module mean parameter count is correct
|
- |
|
second module has correct srcPath
|
- |
|
first-order density is correct
|
- |
|
change cost is correct
|
- |
|
core size is correct
|
- |
|
mean per-function logical LOC is correct
|
- |
|
mean per-function cyclomatic complexity is correct
|
- |
|
mean per-function Halstead effort is correct
|
- |
|
mean per-function parameter count is correct
|
- |
|
mean per-function maintainability index is correct
|
- |
|
two modules with different options:
|
- |
5 |
should have default values if we call with skipCalculation
|
- |
|
should have default coreSize and visibilityMatrix if we call with noCoreSize
|
- |
|
should be able to run process
|
- |
|
should be able to run process without calculating coreSize
|
- |
|
should be able to run processAsync
|
- |
|
local source + NPM module typhonjs-escomplex-commons test w/ serializeModules false:
|
- |
2 |
modules are in correct order
|
- |
|
modules only contains object hash w/ filePath, srcPath and srcPathAlias entries
|
- |
|
local source + NPM module typhonjs-escomplex-commons and typhonjs-escomplex-module test w/ dependencies:
|
- |
3 |
modules are in correct order
|
- |
|
adjacency list is correct
|
- |
|
visibility list is correct
|
- |
|
cjs modules with dependencies:
|
- |
6 |
modules are in correct order
|
- |
|
adjacency list is correct
|
- |
|
visibility list is correct
|
- |
|
first order density is correct
|
- |
|
change cost is correct
|
- |
|
core size is correct
|
- |
|
cjs modules with dynamic dependencies:
|
- |
6 |
modules are in correct order
|
- |
|
adjacency list is correct
|
- |
|
visibility list is correct
|
- |
|
first order density is correct
|
- |
|
change cost is correct
|
- |
|
core size is correct
|
- |
|
esm modules with dependencies:
|
- |
6 |
modules are in correct order
|
- |
|
adjacency list is correct
|
- |
|
visibility list is correct
|
- |
|
first order density is correct
|
- |
|
change cost is correct
|
- |
|
core size is correct
|
- |
|
esm modules with dynamic dependencies:
|
- |
6 |
modules are in correct order
|
- |
|
adjacency list is correct
|
- |
|
visibility list is correct
|
- |
|
first order density is correct
|
- |
|
change cost is correct
|
- |
|
core size is correct
|
- |
|
MacCormack, Rusnak & Baldwin example:
|
- |
6 |
modules are in correct order
|
- |
|
adjacency list is correct
|
- |
|
visibility list is correct
|
- |
|
first order density is correct
|
- |
|
change cost is correct
|
- |
|
core size is correct
|
- |
|
large project calculation performance
|
- |
3 |
deserialize JSON object should be sufficiently fast
|
- |
|
running calculations should be sufficiently fast
|
- |
|
running analyze should be sufficiently fast
|
- |
|