@@ -363,7 +363,7 @@ private function calculateStatistics(array $classes, array $traits, array $funct
363363 $ methodPathCoverage = $ method ->executablePaths > 0 ? ($ method ->executedPaths / $ method ->executablePaths ) * 100 : 0 ;
364364
365365 $ method ->coverage = $ methodBranchCoverage > 0 ? $ methodBranchCoverage : $ methodLineCoverage ;
366- $ method ->crap = ( new CrapIndex ($ method ->ccn , $ methodPathCoverage > 0 ? $ methodPathCoverage : $ methodLineCoverage) )->asString ();
366+ $ method ->crap = new CrapIndex ($ method ->ccn , $ methodPathCoverage > 0 ? $ methodPathCoverage : $ methodLineCoverage )->asString ();
367367
368368 $ trait ->ccn += $ method ->ccn ;
369369 }
@@ -375,7 +375,7 @@ private function calculateStatistics(array $classes, array $traits, array $funct
375375 $ traitPathCoverage = $ trait ->executablePaths > 0 ? ($ trait ->executedPaths / $ trait ->executablePaths ) * 100 : 0 ;
376376
377377 $ trait ->coverage = $ traitBranchCoverage > 0 ? $ traitBranchCoverage : $ traitLineCoverage ;
378- $ trait ->crap = ( new CrapIndex ($ trait ->ccn , $ traitPathCoverage > 0 ? $ traitPathCoverage : $ traitLineCoverage) )->asString ();
378+ $ trait ->crap = new CrapIndex ($ trait ->ccn , $ traitPathCoverage > 0 ? $ traitPathCoverage : $ traitLineCoverage )->asString ();
379379
380380 if ($ trait ->executableLines > 0 && $ trait ->coverage === 100 ) {
381381 $ this ->numTestedClasses ++;
@@ -391,7 +391,7 @@ private function calculateStatistics(array $classes, array $traits, array $funct
391391 $ methodPathCoverage = $ method ->executablePaths > 0 ? ($ method ->executedPaths / $ method ->executablePaths ) * 100 : 0 ;
392392
393393 $ method ->coverage = $ methodBranchCoverage > 0 ? $ methodBranchCoverage : $ methodLineCoverage ;
394- $ method ->crap = ( new CrapIndex ($ method ->ccn , $ methodPathCoverage > 0 ? $ methodPathCoverage : $ methodLineCoverage) )->asString ();
394+ $ method ->crap = new CrapIndex ($ method ->ccn , $ methodPathCoverage > 0 ? $ methodPathCoverage : $ methodLineCoverage )->asString ();
395395
396396 $ class ->ccn += $ method ->ccn ;
397397 }
@@ -403,7 +403,7 @@ private function calculateStatistics(array $classes, array $traits, array $funct
403403 $ classPathCoverage = $ class ->executablePaths > 0 ? ($ class ->executedPaths / $ class ->executablePaths ) * 100 : 0 ;
404404
405405 $ class ->coverage = $ classBranchCoverage > 0 ? $ classBranchCoverage : $ classLineCoverage ;
406- $ class ->crap = ( new CrapIndex ($ class ->ccn , $ classPathCoverage > 0 ? $ classPathCoverage : $ classLineCoverage) )->asString ();
406+ $ class ->crap = new CrapIndex ($ class ->ccn , $ classPathCoverage > 0 ? $ classPathCoverage : $ classLineCoverage )->asString ();
407407
408408 if ($ class ->executableLines > 0 && $ class ->coverage === 100 ) {
409409 $ this ->numTestedClasses ++;
@@ -418,7 +418,7 @@ private function calculateStatistics(array $classes, array $traits, array $funct
418418 $ functionPathCoverage = $ function ->executablePaths > 0 ? ($ function ->executedPaths / $ function ->executablePaths ) * 100 : 0 ;
419419
420420 $ function ->coverage = $ functionBranchCoverage > 0 ? $ functionBranchCoverage : $ functionLineCoverage ;
421- $ function ->crap = ( new CrapIndex ($ function ->ccn , $ functionPathCoverage > 0 ? $ functionPathCoverage : $ functionLineCoverage) )->asString ();
421+ $ function ->crap = new CrapIndex ($ function ->ccn , $ functionPathCoverage > 0 ? $ functionPathCoverage : $ functionLineCoverage )->asString ();
422422
423423 if ($ function ->coverage === 100 ) {
424424 $ this ->numTestedFunctions ++;
0 commit comments