Showing 479 of 479 total issues
Method apply
has 29 lines of code (exceeds 25 allowed). Consider refactoring. 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
public function handle()
{
$this->line('SeAT Admin Login URL Generator');
Similar blocks of code found in 2 locations. Consider refactoring. Open
return CharacterWalletJournal::select('first_party_id', 'second_party_id', 'ref_type', 'category', 'entity_id as party_id', 'name as party_name', DB::raw('count(*) as total'),
DB::raw("
CASE
when universe_names.category = 'character' then
(SELECT corporation_id FROM character_affiliations WHERE character_id = universe_names.entity_id)
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 103.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
CharacterWalletJournal::select('first_party_id', 'second_party_id', 'ref_type', 'category', 'entity_id as party_id', 'name as party_name', DB::raw('count(*) as total'), DB::raw("CASE when universe_names.category = 'character' then (SELECT corporation_id FROM character_affiliations WHERE character_id = universe_names.entity_id) when universe_names.category = 'corporation' then (SELECT corporation_id FROM character_affiliations WHERE corporation_id = universe_names.entity_id LIMIT 1) end AS corporation_id, CASE when universe_names.category = 'character' then (SELECT alliance_id FROM character_affiliations WHERE character_id = universe_names.entity_id) when universe_names.category = 'corporation' then (SELECT alliance_id FROM character_affiliations WHERE corporation_id = universe_names.entity_id LIMIT 1) end AS alliance_id, CASE when universe_names.category = 'character' then (SELECT faction_id FROM character_affiliations WHERE character_id = universe_names.entity_id) when universe_names.category = 'corporation' then (SELECT faction_id FROM character_affiliations WHERE corporation_id = universe_names.entity_id LIMIT 1) end AS faction_id"))
->leftJoin('universe_names', 'universe_names.entity_id', '=', 'character_wallet_journals.second_party_id')
->whereIn('character_wallet_journals.character_id', $character_ids->toArray())
->whereNotIn('character_wallet_journals.second_party_id', $character_ids->toArray())
->groupBy('first_party_id', 'second_party_id', 'ref_type', 'category', 'party_id', 'party_name')
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 103.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function _group
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_group: function ( level, rows ) {
var fns = $.isArray( this.c.dataSrc ) ? this.c.dataSrc : [ this.c.dataSrc ];
var fn = DataTable.ext.oApi._fnGetObjectDataFn( fns[ level ] );
var dt = this.s.dt;
var group, last;
Method store
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function store(ProbeReport $request)
{
$report = $request->input('moon-report');
// enforce tabulation spacer
Method characterTopMailInteractions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. 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
Method ajax
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function ajax()
{
return datatables()
->eloquent($this->applyScopes($this->query()))
->editColumn('name', function ($row) {
Method index
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function index(Request $request)
{
$squads = Squad::with('members', 'moderators', 'applications');
if ($request->has('filters')) {
Method handleJobDispatch
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function handleJobDispatch(Collection $job_classes, Request $request)
{
$job_classes->each(function ($class) use ($request) {
switch (true) {
Method ajax
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function ajax()
{
return datatables()
->eloquent($this->applyScopes($this->query()))
->editColumn('name', function ($row) {
Method characterTopWalletTransactionInteractions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function characterTopWalletTransactionInteractions(Collection $character_ids): Builder
{
return CharacterWalletTransaction::select('client_id', 'category', 'entity_id as party_id', 'name as party_name', DB::raw('count(*) as total'),
DB::raw("
Method postUpdateSharelink
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postUpdateSharelink(Sharelink $request)
{
// Validate our character id is valid for the submitting user
if ((int) $request->input('user_sharelink_character_id') !== 0) {
$requested_character = auth()->user()->characters->contains((int) $request->input('user_sharelink_character_id'));
Method addCorporationPermissionScope
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addCorporationPermissionScope($query, string $ability)
{
if (auth()->user()->isAdmin())
return $query;
Method getStarbaseModules
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getStarbaseModules(int $corporation_id, int $starbase_id): Collection
{
// retrieving starbase location
$starbase = CorporationStarbase::where('starbase_id', $starbase_id)
Method getSystems
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getSystems(Request $request)
{
if ($request->query('_type', 'query') == 'find') {
$system = SolarSystem::find($request->query('q', 0));
Similar blocks of code found in 3 locations. Consider refactoring. Open
return datatables()
->eloquent($this->applyScopes($this->query()))
->editColumn('timestamp', function ($row) {
return view('web::partials.date', ['datetime' => $row->timestamp])->render();
})
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 102.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
return datatables()->eloquent($this->query())
->editColumn('users', function ($row) {
return $row->users->filter(function ($user) { return $user->name !== 'admin'; })->count();
})
->editColumn('permissions', function ($row) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 102.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
return datatables()
->eloquent($this->applyScopes($this->query()))
->editColumn('created_at', function ($row) {
return view('web::partials.date', ['datetime' => $row->created])->render();
})
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 102.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
return datatables()
->eloquent($this->applyScopes($this->query()))
->editColumn('event_date', function ($row) {
return view('web::partials.date', ['datetime' => $row->event_date])->render();
})
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 102.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76