src/Http/Controllers/Support/SearchController.php
Method getSearchMailData
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getSearchMailData(Request $request)
{
$mail = $this->doSearchCharacterMail();
Method getSearchCharacterAssetsData
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getSearchCharacterAssetsData(Request $request)
{
$scope = new CharacterScope('character.asset');
$query = CharacterAsset::with('character', 'type', 'type.group', 'station', 'container', 'container.station',
Avoid too many return
statements within this method. Open
Open
return $query->whereRaw('character_assets.name LIKE ?', ["%$search%"]);
Avoid too many return
statements within this method. Open
Open
return view('web::partials.type', [
'type_id' => $row->type->typeID,
'type_name' => $row->type->typeName,
'variation' => $row->type->group->categoryID == 9 ? 'bpc' : 'icon',
]);
Avoid too many return
statements within this method. Open
Open
return $table->make(true);
Avoid too many return
statements within this method. Open
Open
return $row->station->name ?: ($row->structure->name ?: $row->container->name);
The class SearchController has a coupling between objects value of 16. Consider to reduce the number of dependencies under 13. Open
Open
class SearchController extends Controller
{
/**
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
Avoid unused parameters such as '$request'. Open
Open
public function getSearchCharactersData(Request $request)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$request'. Open
Open
public function getSearchCharacterSkillsData(Request $request)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$request'. Open
Open
public function getSearchCorporationsData(Request $request)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$request'. Open
Open
public function getSearchMailData(Request $request)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$request'. Open
Open
public function getSearchCharacterAssetsData(Request $request)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}