Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Apr 2015 at 17:55 UTC
Updated:
14 Mar 2016 at 03:14 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #1
jhedstromComment #2
jhedstromComment #3
jhedstromComment #4
jhedstromComment #5
mile23Try this on.
CRAP scores:
DiffOp 132 -> 26
HWLDFWordAccumulator also 132 -> 26
DiffEngine 12,210 -> 4,318
I only tested public methods using no mocking. Some of the higher complexity public methods look like they might not be used by core.
Diff::check(), in fact, says it's only for debugging purposes.Also verified that patch #76 in #2337283: Add a composer.json file to every component requires drupal/utility for this component.
Some of the higher CRAP score methods really need some refactoring. That's only possible if we test them. ::gulp::
Comment #7
mile23Typo. Amazing how PHPUnit can find it but run-tests.sh can't. :-)
Comment #8
dawehnerLet's use string keys to explain the different testcases better
Note: The recommended way is now to not use the annotation but rather the setExpectedException method, sorry
Comment #9
mile23#8.1: Not sure what you mean. Read the test to see what it does.
#8.2: Doesn't make any sense, but OK.
Comment #10
dawehnerThis is entirely not the point. The point is having a MUCh easier time to quickly scan it, for example when you have a test failure.
PhpUnit is showing those keys additional.
Comment #11
mile23OK, gotcha. +1
Now who will RTBC since you patched it? :-)
Comment #12
dawehnerCome on, I just changed array keys :)
Comment #13
catchCommitted/pushed to 8.1.x and cherry-picked to 8.0.x. Thanks!