eisen-dev/eisen_front

View on GitHub
webd/includes/DbAction.php

Summary

Maintainability
F
4 days
Test Coverage

Showing 186 of 186 total issues

File DbAction.php has 599 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
* Eisen Frontend
* http://eisen-dev.github.io
*
Severity: Major
Found in webd/includes/DbAction.php - About 1 day to fix

    Method TableCreation has 136 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    public function TableCreation($dbh)
    {
     
    $this->CreateDbTable(
    'user_info',
    Severity: Major
    Found in webd/includes/DbAction.php - About 5 hrs to fix

      DbAction has 33 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class DbAction
      {
      /**
      * @return Logger
      */
      Severity: Minor
      Found in webd/includes/DbAction.php - About 4 hrs to fix

        The class DbAction has 33 non-getter- and setter-methods. Consider refactoring DbAction to keep number of methods under 25.
        Open

        class DbAction
        {
        /**
        * @return Logger
        */
        Severity: Minor
        Found in webd/includes/DbAction.php by phpmd

        The class DbAction has 33 public methods. Consider refactoring DbAction to keep number of public methods under 10.
        Open

        class DbAction
        {
        /**
        * @return Logger
        */
        Severity: Minor
        Found in webd/includes/DbAction.php by phpmd

        The class DbAction has an overall complexity of 70 which is very high. The configured complexity threshold is 50.
        Open

        class DbAction
        {
        /**
        * @return Logger
        */
        Severity: Minor
        Found in webd/includes/DbAction.php by phpmd

        Method Connect has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        public function Connect()
        {
        //set static directory
        #TODO use ini config file instead of php.
        include dirname(__FILE__) . '/../connect.php';
        Severity: Minor
        Found in webd/includes/DbAction.php - About 1 hr to fix

          Function Connect has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          public function Connect()
          {
          //set static directory
          #TODO use ini config file instead of php.
          include dirname(__FILE__) . '/../connect.php';
          Severity: Minor
          Found in webd/includes/DbAction.php - About 1 hr to fix

          Function TargetHostRegistration has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          public function TargetHostRegistration($hosts, $dbh, $machine_id, $user_id) {
          $status_id = 'unknown';
          $os = 'unknown';
          $query = $dbh->prepare('INSERT INTO target_host (ipaddress, port, groups, os, status_id, machine_id, user_id)
          VALUES (:ipaddress, :port, :groups, :os, :status_id, :machine_id, :user_id);');
          Severity: Minor
          Found in webd/includes/DbAction.php - About 35 mins to fix

          The method TableCreation() has 158 lines of code. Current threshold is set to 100. Avoid really long methods.
          Open

          public function TableCreation($dbh)
          {
           
          $this->CreateDbTable(
          'user_info',
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid using undefined variables such as '$db_host' which will lead to PHP notices.
          Open

          if (!empty($db_host)) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid using undefined variables such as '$db_host' which will lead to PHP notices.
          Open

          $dsn = "mysql:dbname=$db_name;host=$db_host;charset=utf8";
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid using undefined variables such as '$db_host' which will lead to PHP notices.
          Open

          $dsn = "mysql:host=$db_host";
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid using undefined variables such as '$db_name' which will lead to PHP notices.
          Open

          if (!empty($db_name)) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid using undefined variables such as '$db_name' which will lead to PHP notices.
          Open

          if (!empty($db_name)) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid using undefined variables such as '$db_user' which will lead to PHP notices.
          Open

          $login = $db_user;
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid using undefined variables such as '$db_pass' which will lead to PHP notices.
          Open

          $password = $db_pass;
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid using undefined variables such as '$db_host' which will lead to PHP notices.
          Open

          if (!empty($db_host)) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid using undefined variables such as '$db_name' which will lead to PHP notices.
          Open

          $dbname = "`".str_replace("`", "``", $db_name)."`";
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid using undefined variables such as '$db_user' which will lead to PHP notices.
          Open

          if (!empty($db_user)) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid using undefined variables such as '$db_user' which will lead to PHP notices.
          Open

          if (!empty($db_user)) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid using undefined variables such as '$db_pass' which will lead to PHP notices.
          Open

          if (!empty($db_pass)) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid using undefined variables such as '$db_user' which will lead to PHP notices.
          Open

          $db_user,
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid using undefined variables such as '$db_pass' which will lead to PHP notices.
          Open

          if (!empty($db_pass)) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid using undefined variables such as '$db_name' which will lead to PHP notices.
          Open

          $dsn = "mysql:dbname=$db_name;host=$db_host;charset=utf8";
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid using undefined variables such as '$db_pass' which will lead to PHP notices.
          Open

          $db_pass,
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid using undefined variables such as '$myMachine' which will lead to PHP notices.
          Open

          $myMachine[$i] = [
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Missing class import via use statement (line '69', column '20').
          Open

          $pdo = new PDO($dsn, $login, $password, $opt);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Missing class import via use statement (line '100', column '36').
          Open

          $dbh = new PDO(
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Missing class import via use statement (line '28', column '20').
          Open

          $log = new LoggerAtOnce();
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid unused local variables such as '$cnt'.
          Open

          $cnt = count($data); //in case you need to count all rows
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid unused local variables such as '$cnt'.
          Open

          $cnt = count($data); //in case you need to count all rows
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid unused local variables such as '$cnt'.
          Open

          $cnt = count($data); //in case you need to count all rows
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid unused local variables such as '$cnt'.
          Open

          $cnt = count($data); //in case you need to count all rows
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid unused local variables such as '$myMachine'.
          Open

          $myMachine[$i] = [
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid unused local variables such as '$cnt'.
          Open

          $cnt = count($data); //in case you need to count all rows
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid unused local variables such as '$cnt'.
          Open

          $cnt = count($data); //in case you need to count all rows
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid unused local variables such as '$cnt'.
          Open

          $cnt = count($data); //in case you need to count all rows
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid unused local variables such as '$cnt'.
          Open

          $cnt = count($data); //in case you need to count all rows
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid unused local variables such as '$cnt'.
          Open

          $cnt = count($data); //in case you need to count all rows
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid unused local variables such as '$cnt'.
          Open

          $cnt = count($data); //in case you need to count all rows
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid unused local variables such as '$cnt'.
          Open

          $cnt = count($data); //in case you need to count all rows
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid unused local variables such as '$i'.
          Open

          foreach ($hosts as $i => $row) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid unused local variables such as '$cnt'.
          Open

          $cnt = count($data); //in case you need to count all rows
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid unused local variables such as '$cnt'.
          Open

          $cnt = count($data); //in case you need to count all rows
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid unused local variables such as '$cnt'.
          Open

          $cnt = count($data); //in case you need to count all rows
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          TODO found
          Open

          #TODO use ini config file instead of php.
          Severity: Minor
          Found in webd/includes/DbAction.php by fixme

          TODO found
          Open

          # TODO: it have problem finding duplicate NULL value
          Severity: Minor
          Found in webd/includes/DbAction.php by fixme

          TODO found
          Open

          # TODO: it have problem finding duplicate NULL value
          Severity: Minor
          Found in webd/includes/DbAction.php by fixme

          TODO found
          Open

          # TODO: it have problem finding duplicate NULL value
          Severity: Minor
          Found in webd/includes/DbAction.php by fixme

          TODO found
          Open

          # TODO: it have problem finding duplicate NULL value
          Severity: Minor
          Found in webd/includes/DbAction.php by fixme

          TODO found
          Open

          #TODO use ini config file instead of php.
          Severity: Minor
          Found in webd/includes/DbAction.php by fixme

          TODO found
          Open

          # TODO: it have problem finding duplicate NULL value
          Severity: Minor
          Found in webd/includes/DbAction.php by fixme

          TODO found
          Open

          # TODO: it have problem finding duplicate NULL value
          Severity: Minor
          Found in webd/includes/DbAction.php by fixme

          TODO found
          Open

          # TODO: it have problem finding duplicate NULL value
          Severity: Minor
          Found in webd/includes/DbAction.php by fixme

          TODO found
          Open

          # TODO: it have problem finding duplicate NULL value
          Severity: Minor
          Found in webd/includes/DbAction.php by fixme

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          public function PackageSearch($target_host, $dbh, $search)
          {
          $search = "%$search%";
          $stm = $dbh->prepare("select * from pack_info WHERE target_host=:target_host AND pack_name LIKE :search ;");
          $stm-> bindParam(':search', $search, PDO::PARAM_STR);
          Severity: Major
          Found in webd/includes/DbAction.php and 1 other location - About 1 hr to fix
          webd/includes/DbAction.php on lines 735..749

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          public function installedPackageSearch($target_host, $dbh, $search)
          {
          $search = "%$search%";
          $stm = $dbh->prepare('
          select * from installed_package
          Severity: Major
          Found in webd/includes/DbAction.php and 1 other location - About 1 hr to fix
          webd/includes/DbAction.php on lines 751..761

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

          foreach ($data as $i => $row) {
          $myMachine[$i] = [
          'machine_id' => $row['machine_id'],
          'module' => $row['module'],
          'ipaddress' => $row['ipaddress'],
          Severity: Major
          Found in webd/includes/DbAction.php and 1 other location - About 1 hr to fix
          webd/includes/DbAction.php on lines 318..330

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

          foreach ($data as $i => $row) {
          $myMachine[$i] = [
          'machine_id' => $row['machine_id'],
          'module' => $row['module'],
          'ipaddress' => $row['ipaddress'],
          Severity: Major
          Found in webd/includes/DbAction.php and 1 other location - About 1 hr to fix
          webd/includes/DbAction.php on lines 294..306

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

          public function hostManagerip2id($dbh, $manager_host_ipaddress)
          {
          $query = $dbh->prepare('SELECT * FROM manager_host WHERE ipaddress = :ipaddress ;');
          try {
          $query-> bindParam(':ipaddress', $manager_host_ipaddress, PDO::PARAM_INT);
          Severity: Major
          Found in webd/includes/DbAction.php and 3 other locations - About 55 mins to fix
          webd/includes/DbAction.php on lines 544..556
          webd/includes/DbAction.php on lines 601..613
          webd/includes/DbAction.php on lines 664..680

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

          public function hostManagerList($dbh, $user_id)
          {
          $query = $dbh->prepare('SELECT * FROM manager_host WHERE user_id = :user_id ;');
          try {
          $query-> bindParam(':user_id', $user_id, PDO::PARAM_INT);
          Severity: Major
          Found in webd/includes/DbAction.php and 3 other locations - About 55 mins to fix
          webd/includes/DbAction.php on lines 582..594
          webd/includes/DbAction.php on lines 601..613
          webd/includes/DbAction.php on lines 664..680

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

          public function hostManagerid2ip($dbh, $manager_host_id)
          {
          $query = $dbh->prepare('SELECT * FROM manager_host WHERE machine_id = :machine_id ;');
          try {
          $query-> bindParam(':machine_id', $manager_host_id, PDO::PARAM_INT);
          Severity: Major
          Found in webd/includes/DbAction.php and 3 other locations - About 55 mins to fix
          webd/includes/DbAction.php on lines 544..556
          webd/includes/DbAction.php on lines 582..594
          webd/includes/DbAction.php on lines 664..680

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

          public function targetHostIdInf($dbh, $targetHostId)
          {
          $query = $dbh->prepare('
          SELECT * FROM target_host
          WHERE host_id = :host_id');
          Severity: Major
          Found in webd/includes/DbAction.php and 3 other locations - About 55 mins to fix
          webd/includes/DbAction.php on lines 544..556
          webd/includes/DbAction.php on lines 582..594
          webd/includes/DbAction.php on lines 601..613

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

          public function TargetHostUpdateOS($host, $dbh, $os)
          {
          $query = $dbh->prepare('UPDATE target_host SET os=:os WHERE ipaddress = :ipaddress ;');
          # TODO: it have problem finding duplicate NULL value
          # FIX: cutted value if using to short VARCHAR so never matched
          Severity: Major
          Found in webd/includes/DbAction.php and 3 other locations - About 40 mins to fix
          webd/includes/DbAction.php on lines 429..441
          webd/includes/DbAction.php on lines 563..575
          webd/includes/DbAction.php on lines 620..632

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

          public function targetHostActive($dbh, $active, $machine_id)
          {
          $query = $dbh->prepare('UPDATE manager_host SET active=:active WHERE machine_id = :machine_id ;');
          # TODO: it have problem finding duplicate NULL value
          # FIX: cutted value if using to short VARCHAR so never matched
          Severity: Major
          Found in webd/includes/DbAction.php and 3 other locations - About 40 mins to fix
          webd/includes/DbAction.php on lines 410..422
          webd/includes/DbAction.php on lines 429..441
          webd/includes/DbAction.php on lines 563..575

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

          public function hostManagerStatus($dbh, $manager_host_ipaddress, $status)
          {
          $query = $dbh->prepare('UPDATE manager_host SET status_id=:status_id WHERE ipaddress = :ipaddress ;');
          # TODO: it have problem finding duplicate NULL value
          # FIX: cutted value if using to short VARCHAR so never matched
          Severity: Major
          Found in webd/includes/DbAction.php and 3 other locations - About 40 mins to fix
          webd/includes/DbAction.php on lines 410..422
          webd/includes/DbAction.php on lines 429..441
          webd/includes/DbAction.php on lines 620..632

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

          public function hostManagerActive($dbh, $active, $machine_id)
          {
          $query = $dbh->prepare('UPDATE manager_host SET active=:active WHERE machine_id = :machine_id ;');
          # TODO: it have problem finding duplicate NULL value
          # FIX: cutted value if using to short VARCHAR so never matched
          Severity: Major
          Found in webd/includes/DbAction.php and 3 other locations - About 40 mins to fix
          webd/includes/DbAction.php on lines 410..422
          webd/includes/DbAction.php on lines 563..575
          webd/includes/DbAction.php on lines 620..632

          Avoid excessively long variable names like $manager_host_ipaddress. Keep variable name length under 20.
          Open

          public function hostManagerStatus($dbh, $manager_host_ipaddress, $status)
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid excessively long variable names like $manager_host_ipaddress. Keep variable name length under 20.
          Open

          public function hostManagerip2id($dbh, $manager_host_ipaddress)
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Each class must be in a namespace of at least one level (a top-level vendor name)
          Open

          class DbAction
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 21 and the first side effect is on line 12.
          Open

          <?php
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          The parameter $user_id is not named in camelCase.
          Open

          public function TargetList($user_id, $machine_id, $dbh) {
          $stm = $dbh->prepare("select * from target_host WHERE user_id=:user_id AND machine_id=:machine_id;");
          $stm-> bindParam(':user_id', $user_id, PDO::PARAM_STR);
          $stm-> bindParam(':machine_id', $machine_id, PDO::PARAM_INT);
          $stm->execute();
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $target_host is not named in camelCase.
          Open

          public function PackageList($target_host, $dbh, $start_row, $row_in_table)
          {
          $stm = $dbh->prepare("select * from pack_info WHERE target_host=:target_host LIMIT :start_row, :row_in_table;");
          $stm-> bindParam(':target_host', $target_host, PDO::PARAM_STR);
          $stm-> bindParam(':start_row', $start_row, PDO::PARAM_STR);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $machine_id is not named in camelCase.
          Open

          public function hostManagerActive($dbh, $active, $machine_id)
          {
          $query = $dbh->prepare('UPDATE manager_host SET active=:active WHERE machine_id = :machine_id ;');
          # TODO: it have problem finding duplicate NULL value
          # FIX: cutted value if using to short VARCHAR so never matched
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $start_row is not named in camelCase.
          Open

          public function PackageList($target_host, $dbh, $start_row, $row_in_table)
          {
          $stm = $dbh->prepare("select * from pack_info WHERE target_host=:target_host LIMIT :start_row, :row_in_table;");
          $stm-> bindParam(':target_host', $target_host, PDO::PARAM_STR);
          $stm-> bindParam(':start_row', $start_row, PDO::PARAM_STR);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $host_manager is not named in camelCase.
          Open

          public function hostManagerActiveListFind($user_id, $dbh, $host_manager) {
          $stm = $dbh->prepare('select * from manager_host WHERE user_id=:user_id AND active= 1 AND ipaddress=:host_manager;');
          $stm-> bindParam(':user_id', $user_id, PDO::PARAM_STR);
          $stm-> bindParam(':host_manager', $host_manager, PDO::PARAM_STR);
          $stm->execute();
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $manager_host_id is not named in camelCase.
          Open

          public function hostManagerid2ip($dbh, $manager_host_id)
          {
          $query = $dbh->prepare('SELECT * FROM manager_host WHERE machine_id = :machine_id ;');
          try {
          $query-> bindParam(':machine_id', $manager_host_id, PDO::PARAM_INT);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $manager_host_ipaddress is not named in camelCase.
          Open

          public function hostManagerip2id($dbh, $manager_host_ipaddress)
          {
          $query = $dbh->prepare('SELECT * FROM manager_host WHERE ipaddress = :ipaddress ;');
          try {
          $query-> bindParam(':ipaddress', $manager_host_ipaddress, PDO::PARAM_INT);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $target_host is not named in camelCase.
          Open

          public function PackageSearch($target_host, $dbh, $search)
          {
          $search = "%$search%";
          $stm = $dbh->prepare("select * from pack_info WHERE target_host=:target_host AND pack_name LIKE :search ;");
          $stm-> bindParam(':search', $search, PDO::PARAM_STR);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid variables with short names like $os. Configured minimum length is 3.
          Open

          public function TargetHostUpdateOS($host, $dbh, $os)
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $user_id is not named in camelCase.
          Open

          public function hostManagerActiveList($user_id, $dbh) {
          $stm = $dbh->prepare('select * from manager_host WHERE user_id=:user_id AND active= 1;');
          $stm-> bindParam(':user_id', $user_id, PDO::PARAM_STR);
          $stm->execute();
          $data = $stm->fetchAll();
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $user_id is not named in camelCase.
          Open

          public function hostManagerList($dbh, $user_id)
          {
          $query = $dbh->prepare('SELECT * FROM manager_host WHERE user_id = :user_id ;');
          try {
          $query-> bindParam(':user_id', $user_id, PDO::PARAM_INT);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $target_host is not named in camelCase.
          Open

          public function installedPackageSearch($target_host, $dbh, $search)
          {
          $search = "%$search%";
          $stm = $dbh->prepare('
          select * from installed_package
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $machine_id is not named in camelCase.
          Open

          public function TargetHostRegistration($hosts, $dbh, $machine_id, $user_id) {
          $status_id = 'unknown';
          $os = 'unknown';
          $query = $dbh->prepare('INSERT INTO target_host (ipaddress, port, groups, os, status_id, machine_id, user_id)
          VALUES (:ipaddress, :port, :groups, :os, :status_id, :machine_id, :user_id);');
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $user_id is not named in camelCase.
          Open

          public function TargetHostRegistration($hosts, $dbh, $machine_id, $user_id) {
          $status_id = 'unknown';
          $os = 'unknown';
          $query = $dbh->prepare('INSERT INTO target_host (ipaddress, port, groups, os, status_id, machine_id, user_id)
          VALUES (:ipaddress, :port, :groups, :os, :status_id, :machine_id, :user_id);');
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $machine_id is not named in camelCase.
          Open

          public function targetHostActive($dbh, $active, $machine_id)
          {
          $query = $dbh->prepare('UPDATE manager_host SET active=:active WHERE machine_id = :machine_id ;');
          # TODO: it have problem finding duplicate NULL value
          # FIX: cutted value if using to short VARCHAR so never matched
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid variables with short names like $pk. Configured minimum length is 3.
          Open

          $pk = '';
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Avoid variables with short names like $os. Configured minimum length is 3.
          Open

          $os = 'unknown';
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $target_host is not named in camelCase.
          Open

          public function targetHostInf($dbh, $target_host, $machine_id)
          {
          $query = $dbh->prepare('
          SELECT * FROM target_host
          WHERE ipaddress = :target_host
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $pack_sys_id is not named in camelCase.
          Open

          public function CountPackage($pack_sys_id, $dbh)
          {
          $cnt=array();
          $stm = $dbh->prepare("select * from installed_package WHERE pack_sys_id=:pack_sys_id;");
          $stm-> bindParam(':pack_sys_id', $pack_sys_id, PDO::PARAM_STR);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $user_id is not named in camelCase.
          Open

          public function hostManagerActiveListFind($user_id, $dbh, $host_manager) {
          $stm = $dbh->prepare('select * from manager_host WHERE user_id=:user_id AND active= 1 AND ipaddress=:host_manager;');
          $stm-> bindParam(':user_id', $user_id, PDO::PARAM_STR);
          $stm-> bindParam(':host_manager', $host_manager, PDO::PARAM_STR);
          $stm->execute();
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $machine_id is not named in camelCase.
          Open

          public function hostManagerDelete($dbh, $machine_id)
          {
          $query = $dbh->prepare('DELETE FROM manager_host WHERE machine_id = :machine_id ;');
          # TODO: it have problem finding duplicate NULL value
          # FIX: cutted value if using to short VARCHAR so never matched
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $manager_host_ipaddress is not named in camelCase.
          Open

          public function hostManagerStatus($dbh, $manager_host_ipaddress, $status)
          {
          $query = $dbh->prepare('UPDATE manager_host SET status_id=:status_id WHERE ipaddress = :ipaddress ;');
          # TODO: it have problem finding duplicate NULL value
          # FIX: cutted value if using to short VARCHAR so never matched
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $machine_id is not named in camelCase.
          Open

          public function TargetList($user_id, $machine_id, $dbh) {
          $stm = $dbh->prepare("select * from target_host WHERE user_id=:user_id AND machine_id=:machine_id;");
          $stm-> bindParam(':user_id', $user_id, PDO::PARAM_STR);
          $stm-> bindParam(':machine_id', $machine_id, PDO::PARAM_INT);
          $stm->execute();
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $task_id is not named in camelCase.
          Open

          public function taskList($dbh, $task_id)
          {
          $query = $dbh->prepare('SELECT * FROM task_result WHERE task_id = :task_id ;');
          try {
          $query->bindParam(':task_id', $task_id, PDO::PARAM_STR);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $machine_id is not named in camelCase.
          Open

          public function targetHostInf($dbh, $target_host, $machine_id)
          {
          $query = $dbh->prepare('
          SELECT * FROM target_host
          WHERE ipaddress = :target_host
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $target_host is not named in camelCase.
          Open

          public function installedPackageList($target_host, $dbh)
          {
          $stm = $dbh->prepare("select * from installed_package WHERE target_host=:target_host;");
          $stm-> bindParam(':target_host', $target_host, PDO::PARAM_STR);
          $stm->execute();
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The parameter $row_in_table is not named in camelCase.
          Open

          public function PackageList($target_host, $dbh, $start_row, $row_in_table)
          {
          $stm = $dbh->prepare("select * from pack_info WHERE target_host=:target_host LIMIT :start_row, :row_in_table;");
          $stm-> bindParam(':target_host', $target_host, PDO::PARAM_STR);
          $stm-> bindParam(':start_row', $start_row, PDO::PARAM_STR);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          Method name "DbAction::TargetList" is not in camel caps format
          Open

          public function TargetList($user_id, $machine_id, $dbh) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Blank line found at end of control structure
          Open

           
           
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Method name "DbAction::TargetHostRegistration" is not in camel caps format
          Open

          public function TargetHostRegistration($hosts, $dbh, $machine_id, $user_id) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Method name "DbAction::Check" is not in camel caps format
          Open

          public function Check()
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Blank line found at end of control structure
          Open

           
           
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Blank line found at end of control structure
          Open

           
           
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Method name "DbAction::Connect" is not in camel caps format
          Open

          public function Connect()
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Method name "DbAction::TargetHostUpdateOS" is not in camel caps format
          Open

          public function TargetHostUpdateOS($host, $dbh, $os)
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Blank line found at end of control structure
          Open

           
           
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Method name "DbAction::TableCreation" is not in camel caps format
          Open

          public function TableCreation($dbh)
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Blank line found at end of control structure
          Open

           
           
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Method name "DbAction::PackageList" is not in camel caps format
          Open

          public function PackageList($target_host, $dbh, $start_row, $row_in_table)
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          There must be one blank line after the last USE statement; 2 found;
          Open

          use Monolog\Logger;
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Blank line found at end of control structure
          Open

           
           
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Method name "DbAction::CreateDbTable" is not in camel caps format
          Open

          public function CreateDbTable($table,$fields,$dbh)
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Blank line found at end of control structure
          Open

           
           
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Method name "DbAction::some_logging_function" is not in camel caps format
          Open

          public function some_logging_function($log)
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Method name "DbAction::CountPackage" is not in camel caps format
          Open

          public function CountPackage($pack_sys_id, $dbh)
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Method name "DbAction::PackageSearch" is not in camel caps format
          Open

          public function PackageSearch($target_host, $dbh, $search)
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Line exceeds 120 characters; contains 125 characters
          Open

          $stm = $dbh->prepare('select * from manager_host WHERE user_id=:user_id AND active= 1 AND ipaddress=:host_manager;');
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Line indented incorrectly; expected 8 spaces, found 12
          Open

          } catch (PDOException $ex) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Line indented incorrectly; expected 8 spaces, found 12
          Open

          }
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Opening brace should be on a new line
          Open

          public function hostManagerActiveListFind($user_id, $dbh, $host_manager) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Opening brace should be on a new line
          Open

          public function TargetHostRegistration($hosts, $dbh, $machine_id, $user_id) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Opening brace should be on a new line
          Open

          public function hostManagerActiveList($user_id, $dbh) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Opening brace should be on a new line
          Open

          public function TargetList($user_id, $machine_id, $dbh) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Line indented incorrectly; expected 8 spaces, found 12
          Open

          try {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          No space found after comma in function call
          Open

          $sql = rtrim($sql,',') . ', PRIMARY KEY (`'.$pk.'`)';
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Expected 1 space between comma and argument "$fields"; 0 found
          Open

          public function CreateDbTable($table,$fields,$dbh)
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Expected 1 space between comma and argument "$dbh"; 0 found
          Open

          public function CreateDbTable($table,$fields,$dbh)
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Expected 1 space after closing parenthesis; found 9
          Open

          foreach($fields as $field => $type)
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Expected 1 space after closing parenthesis; found 13
          Open

          if (preg_match('/AUTO_INCREMENT/i', $type))
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          Expected 1 space after FOREACH keyword; 0 found
          Open

          foreach($fields as $field => $type)
          Severity: Minor
          Found in webd/includes/DbAction.php by phpcodesniffer

          The variable $db_name is not named in camelCase.
          Open

          public function Check()
          {
          #TODO use ini config file instead of php.
          include dirname(__FILE__) . '/../connect.php';
          if (!empty($db_host)) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $db_name is not named in camelCase.
          Open

          public function Connect()
          {
          //set static directory
          #TODO use ini config file instead of php.
          include dirname(__FILE__) . '/../connect.php';
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $db_host is not named in camelCase.
          Open

          public function Check()
          {
          #TODO use ini config file instead of php.
          include dirname(__FILE__) . '/../connect.php';
          if (!empty($db_host)) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $db_pass is not named in camelCase.
          Open

          public function Check()
          {
          #TODO use ini config file instead of php.
          include dirname(__FILE__) . '/../connect.php';
          if (!empty($db_host)) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $db_name is not named in camelCase.
          Open

          public function Connect()
          {
          //set static directory
          #TODO use ini config file instead of php.
          include dirname(__FILE__) . '/../connect.php';
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $db_pass is not named in camelCase.
          Open

          public function Check()
          {
          #TODO use ini config file instead of php.
          include dirname(__FILE__) . '/../connect.php';
          if (!empty($db_host)) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $db_pass is not named in camelCase.
          Open

          public function Connect()
          {
          //set static directory
          #TODO use ini config file instead of php.
          include dirname(__FILE__) . '/../connect.php';
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $db_user is not named in camelCase.
          Open

          public function Check()
          {
          #TODO use ini config file instead of php.
          include dirname(__FILE__) . '/../connect.php';
          if (!empty($db_host)) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $db_user is not named in camelCase.
          Open

          public function Connect()
          {
          //set static directory
          #TODO use ini config file instead of php.
          include dirname(__FILE__) . '/../connect.php';
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $db_name is not named in camelCase.
          Open

          public function Check()
          {
          #TODO use ini config file instead of php.
          include dirname(__FILE__) . '/../connect.php';
          if (!empty($db_host)) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $db_user is not named in camelCase.
          Open

          public function Check()
          {
          #TODO use ini config file instead of php.
          include dirname(__FILE__) . '/../connect.php';
          if (!empty($db_host)) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $db_pass is not named in camelCase.
          Open

          public function Connect()
          {
          //set static directory
          #TODO use ini config file instead of php.
          include dirname(__FILE__) . '/../connect.php';
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $db_host is not named in camelCase.
          Open

          public function Connect()
          {
          //set static directory
          #TODO use ini config file instead of php.
          include dirname(__FILE__) . '/../connect.php';
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $db_host is not named in camelCase.
          Open

          public function Connect()
          {
          //set static directory
          #TODO use ini config file instead of php.
          include dirname(__FILE__) . '/../connect.php';
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $db_user is not named in camelCase.
          Open

          public function Connect()
          {
          //set static directory
          #TODO use ini config file instead of php.
          include dirname(__FILE__) . '/../connect.php';
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $db_host is not named in camelCase.
          Open

          public function Check()
          {
          #TODO use ini config file instead of php.
          include dirname(__FILE__) . '/../connect.php';
          if (!empty($db_host)) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $host_manager is not named in camelCase.
          Open

          public function hostManagerActiveListFind($user_id, $dbh, $host_manager) {
          $stm = $dbh->prepare('select * from manager_host WHERE user_id=:user_id AND active= 1 AND ipaddress=:host_manager;');
          $stm-> bindParam(':user_id', $user_id, PDO::PARAM_STR);
          $stm-> bindParam(':host_manager', $host_manager, PDO::PARAM_STR);
          $stm->execute();
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $machine_id is not named in camelCase.
          Open

          public function TargetList($user_id, $machine_id, $dbh) {
          $stm = $dbh->prepare("select * from target_host WHERE user_id=:user_id AND machine_id=:machine_id;");
          $stm-> bindParam(':user_id', $user_id, PDO::PARAM_STR);
          $stm-> bindParam(':machine_id', $machine_id, PDO::PARAM_INT);
          $stm->execute();
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $status_id is not named in camelCase.
          Open

          public function TargetHostRegistration($hosts, $dbh, $machine_id, $user_id) {
          $status_id = 'unknown';
          $os = 'unknown';
          $query = $dbh->prepare('INSERT INTO target_host (ipaddress, port, groups, os, status_id, machine_id, user_id)
          VALUES (:ipaddress, :port, :groups, :os, :status_id, :machine_id, :user_id);');
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $machine_id is not named in camelCase.
          Open

          public function TargetHostRegistration($hosts, $dbh, $machine_id, $user_id) {
          $status_id = 'unknown';
          $os = 'unknown';
          $query = $dbh->prepare('INSERT INTO target_host (ipaddress, port, groups, os, status_id, machine_id, user_id)
          VALUES (:ipaddress, :port, :groups, :os, :status_id, :machine_id, :user_id);');
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $machine_id is not named in camelCase.
          Open

          public function targetHostInf($dbh, $target_host, $machine_id)
          {
          $query = $dbh->prepare('
          SELECT * FROM target_host
          WHERE ipaddress = :target_host
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $machine_id is not named in camelCase.
          Open

          public function hostManagerDelete($dbh, $machine_id)
          {
          $query = $dbh->prepare('DELETE FROM manager_host WHERE machine_id = :machine_id ;');
          # TODO: it have problem finding duplicate NULL value
          # FIX: cutted value if using to short VARCHAR so never matched
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $user_id is not named in camelCase.
          Open

          public function TargetList($user_id, $machine_id, $dbh) {
          $stm = $dbh->prepare("select * from target_host WHERE user_id=:user_id AND machine_id=:machine_id;");
          $stm-> bindParam(':user_id', $user_id, PDO::PARAM_STR);
          $stm-> bindParam(':machine_id', $machine_id, PDO::PARAM_INT);
          $stm->execute();
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $target_host is not named in camelCase.
          Open

          public function PackageSearch($target_host, $dbh, $search)
          {
          $search = "%$search%";
          $stm = $dbh->prepare("select * from pack_info WHERE target_host=:target_host AND pack_name LIKE :search ;");
          $stm-> bindParam(':search', $search, PDO::PARAM_STR);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $machine_id is not named in camelCase.
          Open

          public function targetHostActive($dbh, $active, $machine_id)
          {
          $query = $dbh->prepare('UPDATE manager_host SET active=:active WHERE machine_id = :machine_id ;');
          # TODO: it have problem finding duplicate NULL value
          # FIX: cutted value if using to short VARCHAR so never matched
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $manager_host_id is not named in camelCase.
          Open

          public function hostManagerid2ip($dbh, $manager_host_id)
          {
          $query = $dbh->prepare('SELECT * FROM manager_host WHERE machine_id = :machine_id ;');
          try {
          $query-> bindParam(':machine_id', $manager_host_id, PDO::PARAM_INT);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $pack_sys_id is not named in camelCase.
          Open

          public function CountPackage($pack_sys_id, $dbh)
          {
          $cnt=array();
          $stm = $dbh->prepare("select * from installed_package WHERE pack_sys_id=:pack_sys_id;");
          $stm-> bindParam(':pack_sys_id', $pack_sys_id, PDO::PARAM_STR);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $task_id is not named in camelCase.
          Open

          public function taskList($dbh, $task_id)
          {
          $query = $dbh->prepare('SELECT * FROM task_result WHERE task_id = :task_id ;');
          try {
          $query->bindParam(':task_id', $task_id, PDO::PARAM_STR);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $target_host is not named in camelCase.
          Open

          public function targetHostInf($dbh, $target_host, $machine_id)
          {
          $query = $dbh->prepare('
          SELECT * FROM target_host
          WHERE ipaddress = :target_host
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $user_id is not named in camelCase.
          Open

          public function TargetHostRegistration($hosts, $dbh, $machine_id, $user_id) {
          $status_id = 'unknown';
          $os = 'unknown';
          $query = $dbh->prepare('INSERT INTO target_host (ipaddress, port, groups, os, status_id, machine_id, user_id)
          VALUES (:ipaddress, :port, :groups, :os, :status_id, :machine_id, :user_id);');
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $user_id is not named in camelCase.
          Open

          public function hostManagerActiveList($user_id, $dbh) {
          $stm = $dbh->prepare('select * from manager_host WHERE user_id=:user_id AND active= 1;');
          $stm-> bindParam(':user_id', $user_id, PDO::PARAM_STR);
          $stm->execute();
          $data = $stm->fetchAll();
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $target_host is not named in camelCase.
          Open

          public function installedPackageList($target_host, $dbh)
          {
          $stm = $dbh->prepare("select * from installed_package WHERE target_host=:target_host;");
          $stm-> bindParam(':target_host', $target_host, PDO::PARAM_STR);
          $stm->execute();
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $pack_sys_id is not named in camelCase.
          Open

          public function CountPackage($pack_sys_id, $dbh)
          {
          $cnt=array();
          $stm = $dbh->prepare("select * from installed_package WHERE pack_sys_id=:pack_sys_id;");
          $stm-> bindParam(':pack_sys_id', $pack_sys_id, PDO::PARAM_STR);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $status_id is not named in camelCase.
          Open

          public function TargetHostRegistration($hosts, $dbh, $machine_id, $user_id) {
          $status_id = 'unknown';
          $os = 'unknown';
          $query = $dbh->prepare('INSERT INTO target_host (ipaddress, port, groups, os, status_id, machine_id, user_id)
          VALUES (:ipaddress, :port, :groups, :os, :status_id, :machine_id, :user_id);');
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $machine_id is not named in camelCase.
          Open

          public function hostManagerActive($dbh, $active, $machine_id)
          {
          $query = $dbh->prepare('UPDATE manager_host SET active=:active WHERE machine_id = :machine_id ;');
          # TODO: it have problem finding duplicate NULL value
          # FIX: cutted value if using to short VARCHAR so never matched
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $manager_host_ipaddress is not named in camelCase.
          Open

          public function hostManagerStatus($dbh, $manager_host_ipaddress, $status)
          {
          $query = $dbh->prepare('UPDATE manager_host SET status_id=:status_id WHERE ipaddress = :ipaddress ;');
          # TODO: it have problem finding duplicate NULL value
          # FIX: cutted value if using to short VARCHAR so never matched
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $start_row is not named in camelCase.
          Open

          public function PackageList($target_host, $dbh, $start_row, $row_in_table)
          {
          $stm = $dbh->prepare("select * from pack_info WHERE target_host=:target_host LIMIT :start_row, :row_in_table;");
          $stm-> bindParam(':target_host', $target_host, PDO::PARAM_STR);
          $stm-> bindParam(':start_row', $start_row, PDO::PARAM_STR);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $user_id is not named in camelCase.
          Open

          public function hostManagerList($dbh, $user_id)
          {
          $query = $dbh->prepare('SELECT * FROM manager_host WHERE user_id = :user_id ;');
          try {
          $query-> bindParam(':user_id', $user_id, PDO::PARAM_INT);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $user_id is not named in camelCase.
          Open

          public function hostManagerActiveListFind($user_id, $dbh, $host_manager) {
          $stm = $dbh->prepare('select * from manager_host WHERE user_id=:user_id AND active= 1 AND ipaddress=:host_manager;');
          $stm-> bindParam(':user_id', $user_id, PDO::PARAM_STR);
          $stm-> bindParam(':host_manager', $host_manager, PDO::PARAM_STR);
          $stm->execute();
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $target_host is not named in camelCase.
          Open

          public function PackageList($target_host, $dbh, $start_row, $row_in_table)
          {
          $stm = $dbh->prepare("select * from pack_info WHERE target_host=:target_host LIMIT :start_row, :row_in_table;");
          $stm-> bindParam(':target_host', $target_host, PDO::PARAM_STR);
          $stm-> bindParam(':start_row', $start_row, PDO::PARAM_STR);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $row_in_table is not named in camelCase.
          Open

          public function PackageList($target_host, $dbh, $start_row, $row_in_table)
          {
          $stm = $dbh->prepare("select * from pack_info WHERE target_host=:target_host LIMIT :start_row, :row_in_table;");
          $stm-> bindParam(':target_host', $target_host, PDO::PARAM_STR);
          $stm-> bindParam(':start_row', $start_row, PDO::PARAM_STR);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $target_host is not named in camelCase.
          Open

          public function installedPackageSearch($target_host, $dbh, $search)
          {
          $search = "%$search%";
          $stm = $dbh->prepare('
          select * from installed_package
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The variable $manager_host_ipaddress is not named in camelCase.
          Open

          public function hostManagerip2id($dbh, $manager_host_ipaddress)
          {
          $query = $dbh->prepare('SELECT * FROM manager_host WHERE ipaddress = :ipaddress ;');
          try {
          $query-> bindParam(':ipaddress', $manager_host_ipaddress, PDO::PARAM_INT);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The method Check is not named in camelCase.
          Open

          public function Check()
          {
          #TODO use ini config file instead of php.
          include dirname(__FILE__) . '/../connect.php';
          if (!empty($db_host)) {
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The method Connect is not named in camelCase.
          Open

          public function Connect()
          {
          //set static directory
          #TODO use ini config file instead of php.
          include dirname(__FILE__) . '/../connect.php';
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The method TargetHostUpdateOS is not named in camelCase.
          Open

          public function TargetHostUpdateOS($host, $dbh, $os)
          {
          $query = $dbh->prepare('UPDATE target_host SET os=:os WHERE ipaddress = :ipaddress ;');
          # TODO: it have problem finding duplicate NULL value
          # FIX: cutted value if using to short VARCHAR so never matched
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The method PackageSearch is not named in camelCase.
          Open

          public function PackageSearch($target_host, $dbh, $search)
          {
          $search = "%$search%";
          $stm = $dbh->prepare("select * from pack_info WHERE target_host=:target_host AND pack_name LIKE :search ;");
          $stm-> bindParam(':search', $search, PDO::PARAM_STR);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The method CreateDbTable is not named in camelCase.
          Open

          public function CreateDbTable($table,$fields,$dbh)
          {
           
          $sql = "CREATE TABLE IF NOT EXISTS `$table` (";
          $pk = '';
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The method TargetHostRegistration is not named in camelCase.
          Open

          public function TargetHostRegistration($hosts, $dbh, $machine_id, $user_id) {
          $status_id = 'unknown';
          $os = 'unknown';
          $query = $dbh->prepare('INSERT INTO target_host (ipaddress, port, groups, os, status_id, machine_id, user_id)
          VALUES (:ipaddress, :port, :groups, :os, :status_id, :machine_id, :user_id);');
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The method CountPackage is not named in camelCase.
          Open

          public function CountPackage($pack_sys_id, $dbh)
          {
          $cnt=array();
          $stm = $dbh->prepare("select * from installed_package WHERE pack_sys_id=:pack_sys_id;");
          $stm-> bindParam(':pack_sys_id', $pack_sys_id, PDO::PARAM_STR);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The method TableCreation is not named in camelCase.
          Open

          public function TableCreation($dbh)
          {
           
          $this->CreateDbTable(
          'user_info',
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The method PackageList is not named in camelCase.
          Open

          public function PackageList($target_host, $dbh, $start_row, $row_in_table)
          {
          $stm = $dbh->prepare("select * from pack_info WHERE target_host=:target_host LIMIT :start_row, :row_in_table;");
          $stm-> bindParam(':target_host', $target_host, PDO::PARAM_STR);
          $stm-> bindParam(':start_row', $start_row, PDO::PARAM_STR);
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The method TargetList is not named in camelCase.
          Open

          public function TargetList($user_id, $machine_id, $dbh) {
          $stm = $dbh->prepare("select * from target_host WHERE user_id=:user_id AND machine_id=:machine_id;");
          $stm-> bindParam(':user_id', $user_id, PDO::PARAM_STR);
          $stm-> bindParam(':machine_id', $machine_id, PDO::PARAM_INT);
          $stm->execute();
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd

          The method some_logging_function is not named in camelCase.
          Open

          public function some_logging_function($log)
          {
          echo 'LOG : ' . $log . '<br />';
          }
          Severity: Minor
          Found in webd/includes/DbAction.php by phpmd
          Category
          Status