Showing 186 of 479 total issues
Method data
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function data()
{
return datatables()
->eloquent($this->applyScopes($this->query()))
->editColumn('date', function ($row) {
Method getJournalGraphBalance
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getJournalGraphBalance(CharacterInfo $character)
{
$data = CharacterWalletJournal::with('first_party', 'second_party')
->where('character_id', $character->character_id)
Method ajax
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function ajax()
{
return datatables()
->eloquent($this->applyScopes($this->query()))
->editColumn('from_type', function ($row) {
Method getTopMailFromData
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getTopMailFromData(CharacterInfo $character)
{
if (! request()->has('characters'))
return abort(500);
Method applyRules
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function applyRules(Builder $query, string $group_verb, $rules)
{
$query_operator = $group_verb == 'whereHas' ? 'where' : 'orWhere';
if (is_array($rules))
Function getLocationNameFromDivision
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
private function getLocationNameFromDivision(CorporationAsset $item)
{
// item > division > office > station / structure
if (in_array($item->container->location_flag, ['Impounded', 'OfficeFolder'])) {
if ($item->container->location_type == 'station')
- 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 ajax
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function ajax()
{
return datatables()
->eloquent($this->applyScopes($this->query()))
->editColumn('timestamp', function ($row) {
Method ajax
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function ajax()
{
return datatables()
->eloquent($this->applyScopes($this->query()))
->editColumn('event_date', function ($row) {
Method getChangelogFromApi
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getChangelogFromApi(string $uri, string $body_attribute, string $tag_attribute): string
{
try {
return cache()->remember($this->getChangelogCacheKey($uri), 30, function () use ($uri, $body_attribute, $tag_attribute) {
$changelog = '';
Function unveil
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.unveil = function(threshold, callback) {
var $w = $(window),
th = threshold || 0,
retina = window.devicePixelRatio > 1,
Method ajax
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function ajax()
{
return datatables()
->eloquent($this->query())
->addColumn('characters', function ($row) {
Method getMoonIndicatorsAttribute
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getMoonIndicatorsAttribute()
{
if (is_null($this->moon_indicators)) {
$this->moon_indicators = (object) [
'ubiquitous' => $this->content->filter(function ($type) {
Method ajax
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function ajax()
{
return datatables()
->eloquent($this->applyScopes($this->query()))
->editColumn('name', function ($row) {
Method findOrCreateUser
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function findOrCreateUser(SocialiteUser $eve_user): User
{
// remove all existing tokens with a different hash.
// in case a hash has been altered, it might be because
Method ajax
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function ajax()
{
return datatables()
->eloquent($this->applyScopes($this->query()))
->editColumn('type.typeName', function ($row) {
Method addCharacterPermissionScope
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function addCharacterPermissionScope($query, string $ability)
{
if (auth()->user()->isAdmin())
return $query;
Method apply
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function apply($query)
{
// extract querying table (from)
$table = $query->getQuery()->from;
Method handle
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handle()
{
$this->line('SeAT Admin Login URL Generator');
Method ajax
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function ajax()
{
return datatables()
->eloquent($this->applyScopes($this->query()))
->editColumn('name', function ($row) {
Method characterTopMailInteractions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function characterTopMailInteractions(Collection $character_ids): Builder
{
return MailHeader::select('from', 'entity_id as character_id', 'name as character_name', DB::raw('COUNT(*) as total'),
DB::raw("
CASE