Completed
Push — work-fleets ( b4179a...b8fd67 )
by SuperNova.WS
05:25
created

DBStaticQue   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 34
rs 10
c 1
b 0
f 0
wmc 7
lcom 0
cbo 1

7 Methods

Rating   Name   Duplication   Size   Complexity  
A db_que_list_by_type_location() 0 3 1
A db_que_list_stat() 0 3 1
A db_que_set_time_left_by_id() 0 4 1
A db_que_set_insert() 0 4 1
A db_que_delete_by_id() 0 4 1
A db_que_planet_change_owner() 0 3 1
A db_que_research_change_origin() 0 3 1
1
<?php
2
3
class DBStaticQue {
4
5
  public static function db_que_list_by_type_location($user_id, $planet_id = null, $que_type = false, $for_update = false) {
6
    return classSupernova::db_que_list_by_type_location($user_id, $planet_id, $que_type, $for_update);
7
  }
8
9
  public static function db_que_list_stat() {
10
    return doquery("SELECT que_player_id, sum(que_unit_amount) AS que_unit_amount, que_unit_price FROM `{{que}}` GROUP BY que_player_id, que_unit_price;");
11
  }
12
13
  public static function db_que_set_time_left_by_id($que_id, $que_time_left) {
14
    return classSupernova::db_upd_record_by_id(LOC_QUE, $que_id, "`que_time_left` = {$que_time_left}");
15
    // return doquery("UPDATE {{que}} SET `que_time_left` = {$que_time_left} WHERE `que_id` = {$que_id} LIMIT 1;");
0 ignored issues
show
Unused Code Comprehensibility introduced by
63% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
16
  }
17
18
  public static function db_que_set_insert($set) {
19
    return classSupernova::db_ins_record(LOC_QUE, $set);
20
    // return ($set = trim($set)) ? doquery("INSERT INTO {{que}} SET {$set}") : false;
0 ignored issues
show
Unused Code Comprehensibility introduced by
57% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
21
  }
22
23
  public static function db_que_delete_by_id($que_id) {
24
    return classSupernova::db_del_record_by_id(LOC_QUE, $que_id);
25
    // return doquery("DELETE FROM {{que}} WHERE que_id = {$que_id} LIMIT 1");
0 ignored issues
show
Unused Code Comprehensibility introduced by
63% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
26
  }
27
28
  public static function db_que_planet_change_owner($planet_id, $new_owner_id) {
29
    return doquery("UPDATE {{que}} SET `que_player_id` = {$new_owner_id} WHERE `que_planet_id` = {$planet_id}");
30
  }
31
32
  public static function db_que_research_change_origin($planet_id, $new_planet_id) {
33
    return doquery("UPDATE {{que}} SET `que_planet_id_origin` = {$new_planet_id} WHERE `que_planet_id_origin` = {$planet_id}");
34
  }
35
36
}