Detects if your class and methods are too big and suggest to extract responsibilities and collaborators
"require-dev": {
"elfiggo/brobdingnagian-detector":"^0.1.0"
}
Add the following to your phpspec.yml
under extensions
extensions:
- Elfiggo\Brobdingnagian\Extension
See PhpSpec Extension Documentation if you are having trouble
brobdingnagian:
class-size: 300
method-size: 15
number-of-methods: 5
dependencies: 3
list-brob: true|false
create-csv: true|false
number-of-interfaces: 3
number-of-traits: 1
Use as normal with phpspec, if you want to disable exceptions for Brobdingnagian and list the classes, methods or dependencies instead, then pass the following flag, this has precedence over the phpspec.yml parameter.
phpspec r --list-brob=true (Turns Exceptions Off)
phpspec r --list-brob=false (Turns Exceptions On)
Currently PHP 5.5 and above
Follows php security support release cycle for minimum supported versions
Configurable limitsConfigure Brob Exceptions to not throw if using list
Number of Class dependenciesCount number class construct dependenciesadd configurable limitadd error type
Count number of methodsAdd configurable limitsadd error type
Size of methodsCheck each method sizeCheck number of method dependenciesAdd configurable limitsadd error type
Add List output formattertable view (default)update log message/exception message where appropriateadd back error typegroup class messages together to be more meaningful in large listsexportable option of all in CSV formatadd class size error typerefactoring period
- Add Backlog
- add configurable filter for number of methods (public|private|protected)
add traits detectoradd interfaces detector
- Ship It! (East Croydon)
- Add Dictionary of suggestible class names for roles
- Ship it! (Blackpool)
- Ask to split class/methods into a helper class
- Create New Helper class with Spec stubs of current class
- Ship it! (Derby)