Perl - score = 29/42 ≈ 0.6905
fork?wait:print for'Hello, world!
This will spawn a total of 16384 processes (don't worry though, no more than 15 are ever active at a time), each with a cyclomatic complexity of 3:
E - N + 2P = 8 - 7 + (2·1) = 3
Each time a branch is encountered, both paths are taken; once by the parent, and once by the newly spawned child.
My contention is that because the parent process never stops executing (that is, control is not passed, but rather split in two directions), the child process can not be considered to be running in the same control flow as the parent, but rather in its own. The total complexity diagram would therefore be more accurately depicted as the following:
The nodes from all paths which can never be reached have been removed.
E = 100; N = 73; P = 1 ⇒ CC = 29
Perl - score = 6000000/38 ≈ 157894.74
print eval'0?1:'x6e6."'Hello, world!'"
If you don't like the previous solution, consider this one: 6000000 nested branches, with a code length of 38. It could be argued - in fact I would even argue - that the complexity of this code is exactly 1, as the
true condition of each branch can never be met, and therefore should be excluded from the complexity analysis.
In general, I think solutions of this type trivialize the challenge.