magickatt/MultiContextBDDTalk

View on GitHub

Showing 63 of 63 total issues

The closing brace for the class must go on the next line after the body
Open

}

Blank line found at end of control structure
Open

 
 

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

};

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

});

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

};

Blank line found at start of control structure
Open

foreach ($this->parser->getEntries($rows) as $entry) {

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

});

Function convert has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

public function convert(SeekableIterator $location)
{
foreach ($this->loader->getResources($location) as $resource) {
$rows = $this->loader->getRows($resource);
foreach ($this->parser->getEntries($rows) as $entry) {
Severity: Minor
Found in backend/src/HistoricalMeteorological/Data/Converter.php - About 25 mins to fix

Function getFilesFromDirectory has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

private function getFilesFromDirectory(DirectoryIterator $directory):Generator
{
if (!$directory->isDir() || !$directory->isReadable()) {
throw new InvalidArgumentException('Directory is either not actually a directory or not accessible');
}
Severity: Minor
Found in backend/src/HistoricalMeteorological/Data/Loader/FileLoader.php - About 25 mins to fix

Avoid unused parameters such as '$application'.
Open

$collection->get('/', function (Application $application) {

Avoid using static access to class '\HistoricalMeteorological\Transformer\EntrySummaryTransformer' in method 'createEntryAggregateSummaryCollectionResponse'.
Open

'meta' => EntrySummaryTransformer::transformEntrySummaryToArray($summary),

The method getEntries uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

} else {
$queryBuilder->andWhere('e.year = :yearFrom');
}

Avoid unused private methods such as 'createPluralResponse'.
Open

private function createPluralResponse(CollectionInterface $collection, int $responseCode = 200)
{
return new JsonResponse(
[
'data' => $collection->toArray(),

Avoid using static access to class '\HistoricalMeteorological\Calculator\EntryCollectionSummaryCalculator' in method 'createEntryComparisonSummaryCollectionResponse'.
Open

$summaryComparison = EntryCollectionSummaryCalculator::compareEntryCollections($collection1, $collection2);

Avoid using static access to class '\HistoricalMeteorological\Transformer\EntrySummaryTransformer' in method 'createEntryComparisonSummaryCollectionResponse'.
Open

'meta' => EntrySummaryTransformer::transformEntrySummaryComparisonToArray($summaryComparison),

Avoid using static access to class '\HistoricalMeteorological\Transformer\LocationTransformer' in method 'createLocationResponse'.
Open

return $this->createSingularResponse(LocationTransformer::transformLocationToArray($location), $responseCode);

Avoid using static access to class '\HistoricalMeteorological\Calculator\EntryCollectionSummaryCalculator' in method 'createEntryAggregateSummaryCollectionResponse'.
Open

$summary = EntryCollectionSummaryCalculator::summariseEntryCollection($collection, new EntrySummary());

Line exceeds 120 characters; contains 130 characters
Open

return $responseService->createEntryAggregateSummaryCollectionResponse(new EntryAggregateSummaryCollection($entries));

Line exceeds 120 characters; contains 128 characters
Open

protected function registerControllerRoutes(Application $application, ControllerCollection $collection):ControllerCollection

Line exceeds 120 characters; contains 133 characters
Open

public static function compareEntryCollections(EntryCollection $collection1, EntryCollection $collection2):EntrySummaryComparison
Severity
Category
Status
Source
Language