modified complexity values
extracted  anonymous function to addToTotalComplexity