Showing 16 of 43 total issues
Method configure
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
$this
->setName('run')
->setDescription('Run test suite')
Function indent
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
private function indent($json) : string
{
$result = '';
$pos = 0;
$strLen = strlen($json);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function onBeforeEach
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function onBeforeEach(BeforeEach $event)
{
$request = $event->getRequest();
$config = $request->getRepetitionConfig();
$name = strtolower($request->getName());
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method doRequest
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function doRequest(ParsedRequest $request, $attempt = 0)
{
$attempt++;
$pollingThreshhold = $this->input->getOption('polling_count') - 1;
Method indent
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function indent($json) : string
{
$result = '';
$pos = 0;
$strLen = strlen($json);
Method process
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(ParsedRequest $request)
{
if ($this->shouldExit($request)) {
return;
}
Method computeGuzzleOptions
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function computeGuzzleOptions(ParsedRequest $request): array
{
$options = [];
$options[RequestOptions::ALLOW_REDIRECTS] = false;
$options[RequestOptions::CONNECT_TIMEOUT] = 30;
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
InputInterface $input,
LoggerInterface $logger,
EventDispatcherInterface $dispatcher,
ValidatorService $validatorService,
HttpClient $http,
Method onBeforeEach
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function onBeforeEach(BeforeEach $event)
{
$request = $event->getRequest();
$config = $request->getRepetitionConfig();
$name = strtolower($request->getName());
Function onBeforeEach
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function onBeforeEach(BeforeEach $event)
{
$request = $event->getRequest();
$name = $request->getName();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function validate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function validate(ParsedRequest $request, ParsedResponse $response)
{
$expected = $request->getExpectedResponse()->getHeaders();
$actual = $response->getHeaders();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
InputInterface $input,
EventDispatcherInterface $dispatcher,
LoggerInterface $logger,
Filesystem $filesystem,
ParameterBag $parameterBag,
Function includeHooks
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function includeHooks()
{
foreach ($this->getHookFiles() as $hookname) {
if (class_exists($hookname)) {
/** @var Hook $hook */
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid too many return
statements within this method. Open
return $this->doRequest($request, $attempt);
Function getFormatterByContentType
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getFormatterByContentType(string $type) : Formatter
{
foreach ($this->formatters as $formatter) {
foreach ($formatter->getContentTypes() as $contentType) {
if (strpos($type, $contentType) !== false) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function format
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function format($data) : string
{
$result = [];
/** @var Validator $validator */
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"