File DbAction.php
has 599 lines of code (exceeds 250 allowed). Consider refactoring.
<?php
/**
* Eisen Frontend
* http:
*
Method TableCreation
has 136 lines of code (exceeds 25 allowed). Consider refactoring.
public function TableCreation($dbh)
{
$this->CreateDbTable(
'user_info',
DbAction
has 33 functions (exceeds 20 allowed). Consider refactoring.
class DbAction
{
* @return Logger
*/
The class DbAction has 33 non-getter- and setter-methods. Consider refactoring DbAction to keep number of methods under 25.
class DbAction
{
* @return Logger
*/
The class DbAction has 33 public methods. Consider refactoring DbAction to keep number of public methods under 10.
class DbAction
{
* @return Logger
*/
The class DbAction has an overall complexity of 70 which is very high. The configured complexity threshold is 50.
class DbAction
{
* @return Logger
*/
Method Connect
has 28 lines of code (exceeds 25 allowed). Consider refactoring.
public function Connect()
{
include dirname(__FILE__) . '/../connect.php';
Function Connect
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
public function Connect()
{
include dirname(__FILE__) . '/../connect.php';
Function TargetHostRegistration
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
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);');
The method TableCreation() has 158 lines of code. Current threshold is set to 100. Avoid really long methods.
public function TableCreation($dbh)
{
$this->CreateDbTable(
'user_info',
Avoid using undefined variables such as '$db_host' which will lead to PHP notices.
if (!empty($db_host)) {
Avoid using undefined variables such as '$db_host' which will lead to PHP notices.
$dsn = "mysql:dbname=$db_name;host=$db_host;charset=utf8";
Avoid using undefined variables such as '$db_host' which will lead to PHP notices.
$dsn = "mysql:host=$db_host";
Avoid using undefined variables such as '$db_name' which will lead to PHP notices.
if (!empty($db_name)) {
Avoid using undefined variables such as '$db_name' which will lead to PHP notices.
if (!empty($db_name)) {
Avoid using undefined variables such as '$db_user' which will lead to PHP notices.
$login = $db_user;
Avoid using undefined variables such as '$db_pass' which will lead to PHP notices.
$password = $db_pass;
Avoid using undefined variables such as '$db_host' which will lead to PHP notices.
if (!empty($db_host)) {
Avoid using undefined variables such as '$db_name' which will lead to PHP notices.
$dbname = "`".str_replace("`", "``", $db_name)."`";
Avoid using undefined variables such as '$db_user' which will lead to PHP notices.
if (!empty($db_user)) {
Avoid using undefined variables such as '$db_user' which will lead to PHP notices.
if (!empty($db_user)) {
Avoid using undefined variables such as '$db_pass' which will lead to PHP notices.
if (!empty($db_pass)) {
Avoid using undefined variables such as '$db_user' which will lead to PHP notices.
$db_user,
Avoid using undefined variables such as '$db_pass' which will lead to PHP notices.
if (!empty($db_pass)) {
Avoid using undefined variables such as '$db_name' which will lead to PHP notices.
$dsn = "mysql:dbname=$db_name;host=$db_host;charset=utf8";
Avoid using undefined variables such as '$db_pass' which will lead to PHP notices.
$db_pass,
Avoid using undefined variables such as '$myMachine' which will lead to PHP notices.
$myMachine[$i] = [
Missing class import via use statement (line '69', column '20').
$pdo = new PDO($dsn, $login, $password, $opt);
Missing class import via use statement (line '100', column '36').
$dbh = new PDO(
Missing class import via use statement (line '28', column '20').
$log = new LoggerAtOnce();
Avoid unused local variables such as '$cnt'.
$cnt = count($data);
Avoid unused local variables such as '$cnt'.
$cnt = count($data);
Avoid unused local variables such as '$cnt'.
$cnt = count($data);
Avoid unused local variables such as '$cnt'.
$cnt = count($data);
Avoid unused local variables such as '$myMachine'.
$myMachine[$i] = [
Avoid unused local variables such as '$cnt'.
$cnt = count($data);
Avoid unused local variables such as '$cnt'.
$cnt = count($data);
Avoid unused local variables such as '$cnt'.
$cnt = count($data);
Avoid unused local variables such as '$cnt'.
$cnt = count($data);
Avoid unused local variables such as '$cnt'.
$cnt = count($data);
Avoid unused local variables such as '$cnt'.
$cnt = count($data);
Avoid unused local variables such as '$cnt'.
$cnt = count($data);
Avoid unused local variables such as '$i'.
foreach ($hosts as $i => $row) {
Avoid unused local variables such as '$cnt'.
$cnt = count($data);
Avoid unused local variables such as '$cnt'.
$cnt = count($data);
Avoid unused local variables such as '$cnt'.
$cnt = count($data);
Similar blocks of code found in 2 locations. Consider refactoring.
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);
Similar blocks of code found in 2 locations. Consider refactoring.
public function installedPackageSearch($target_host, $dbh, $search)
{
$search = "%$search%";
$stm = $dbh->prepare('
select * from installed_package
Identical blocks of code found in 2 locations. Consider refactoring.
foreach ($data as $i => $row) {
$myMachine[$i] = [
'machine_id' => $row['machine_id'],
'module' => $row['module'],
'ipaddress' => $row['ipaddress'],
Identical blocks of code found in 2 locations. Consider refactoring.
foreach ($data as $i => $row) {
$myMachine[$i] = [
'machine_id' => $row['machine_id'],
'module' => $row['module'],
'ipaddress' => $row['ipaddress'],
Similar blocks of code found in 4 locations. Consider refactoring.
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);
Similar blocks of code found in 4 locations. Consider refactoring.
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);
Similar blocks of code found in 4 locations. Consider refactoring.
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);
Similar blocks of code found in 4 locations. Consider refactoring.
public function targetHostIdInf($dbh, $targetHostId)
{
$query = $dbh->prepare('
SELECT * FROM target_host
WHERE host_id = :host_id');
Similar blocks of code found in 4 locations. Consider refactoring.
public function TargetHostUpdateOS($host, $dbh, $os)
{
$query = $dbh->prepare('UPDATE target_host SET os=:os WHERE ipaddress = :ipaddress ;');
Similar blocks of code found in 4 locations. Consider refactoring.
public function targetHostActive($dbh, $active, $machine_id)
{
$query = $dbh->prepare('UPDATE manager_host SET active=:active WHERE machine_id = :machine_id ;');
Similar blocks of code found in 4 locations. Consider refactoring.
public function hostManagerStatus($dbh, $manager_host_ipaddress, $status)
{
$query = $dbh->prepare('UPDATE manager_host SET status_id=:status_id WHERE ipaddress = :ipaddress ;');
Similar blocks of code found in 4 locations. Consider refactoring.
public function hostManagerActive($dbh, $active, $machine_id)
{
$query = $dbh->prepare('UPDATE manager_host SET active=:active WHERE machine_id = :machine_id ;');
Avoid excessively long variable names like $manager_host_ipaddress. Keep variable name length under 20.
public function hostManagerStatus($dbh, $manager_host_ipaddress, $status)
Avoid excessively long variable names like $manager_host_ipaddress. Keep variable name length under 20.
public function hostManagerip2id($dbh, $manager_host_ipaddress)
Each class must be in a namespace of at least one level (a top-level vendor name)
class DbAction
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.
<?php
The parameter $user_id is not named in camelCase.
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();
The parameter $target_host is not named in camelCase.
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);
The parameter $machine_id is not named in camelCase.
public function hostManagerActive($dbh, $active, $machine_id)
{
$query = $dbh->prepare('UPDATE manager_host SET active=:active WHERE machine_id = :machine_id ;');
The parameter $start_row is not named in camelCase.
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);
The parameter $host_manager is not named in camelCase.
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();
The parameter $manager_host_id is not named in camelCase.
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);
The parameter $manager_host_ipaddress is not named in camelCase.
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);
The parameter $target_host is not named in camelCase.
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);
Avoid variables with short names like $os. Configured minimum length is 3.
public function TargetHostUpdateOS($host, $dbh, $os)
The parameter $user_id is not named in camelCase.
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();
The parameter $user_id is not named in camelCase.
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);
The parameter $target_host is not named in camelCase.
public function installedPackageSearch($target_host, $dbh, $search)
{
$search = "%$search%";
$stm = $dbh->prepare('
select * from installed_package
The parameter $machine_id is not named in camelCase.
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);');
The parameter $user_id is not named in camelCase.
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);');
The parameter $machine_id is not named in camelCase.
public function targetHostActive($dbh, $active, $machine_id)
{
$query = $dbh->prepare('UPDATE manager_host SET active=:active WHERE machine_id = :machine_id ;');
Avoid variables with short names like $pk. Configured minimum length is 3.
$pk = '';
Avoid variables with short names like $os. Configured minimum length is 3.
$os = 'unknown';
The parameter $target_host is not named in camelCase.
public function targetHostInf($dbh, $target_host, $machine_id)
{
$query = $dbh->prepare('
SELECT * FROM target_host
WHERE ipaddress = :target_host
The parameter $pack_sys_id is not named in camelCase.
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);
The parameter $user_id is not named in camelCase.
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();
The parameter $machine_id is not named in camelCase.
public function hostManagerDelete($dbh, $machine_id)
{
$query = $dbh->prepare('DELETE FROM manager_host WHERE machine_id = :machine_id ;');
The parameter $manager_host_ipaddress is not named in camelCase.
public function hostManagerStatus($dbh, $manager_host_ipaddress, $status)
{
$query = $dbh->prepare('UPDATE manager_host SET status_id=:status_id WHERE ipaddress = :ipaddress ;');
The parameter $machine_id is not named in camelCase.
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();
The parameter $task_id is not named in camelCase.
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);
The parameter $machine_id is not named in camelCase.
public function targetHostInf($dbh, $target_host, $machine_id)
{
$query = $dbh->prepare('
SELECT * FROM target_host
WHERE ipaddress = :target_host
The parameter $target_host is not named in camelCase.
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();
The parameter $row_in_table is not named in camelCase.
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);
Method name "DbAction::TargetList" is not in camel caps format
public function TargetList($user_id, $machine_id, $dbh) {
Blank line found at end of control structure
Method name "DbAction::TargetHostRegistration" is not in camel caps format
public function TargetHostRegistration($hosts, $dbh, $machine_id, $user_id) {
Method name "DbAction::Check" is not in camel caps format
public function Check()
Blank line found at end of control structure
Blank line found at end of control structure
Method name "DbAction::Connect" is not in camel caps format
public function Connect()
Method name "DbAction::TargetHostUpdateOS" is not in camel caps format
public function TargetHostUpdateOS($host, $dbh, $os)
Blank line found at end of control structure
Method name "DbAction::TableCreation" is not in camel caps format
public function TableCreation($dbh)
Blank line found at end of control structure
Method name "DbAction::PackageList" is not in camel caps format
public function PackageList($target_host, $dbh, $start_row, $row_in_table)
There must be one blank line after the last USE statement; 2 found;
use Monolog\Logger;
Blank line found at end of control structure
Method name "DbAction::CreateDbTable" is not in camel caps format
public function CreateDbTable($table,$fields,$dbh)
Blank line found at end of control structure
Method name "DbAction::some_logging_function" is not in camel caps format
public function some_logging_function($log)
Method name "DbAction::CountPackage" is not in camel caps format
public function CountPackage($pack_sys_id, $dbh)
Method name "DbAction::PackageSearch" is not in camel caps format
public function PackageSearch($target_host, $dbh, $search)
Line exceeds 120 characters; contains 125 characters
$stm = $dbh->prepare('select * from manager_host WHERE user_id=:user_id AND active= 1 AND ipaddress=:host_manager;');
Line indented incorrectly; expected 8 spaces, found 12
} catch (PDOException $ex) {
Line indented incorrectly; expected 8 spaces, found 12
}
Opening brace should be on a new line
public function hostManagerActiveListFind($user_id, $dbh, $host_manager) {
Opening brace should be on a new line
public function TargetHostRegistration($hosts, $dbh, $machine_id, $user_id) {
Opening brace should be on a new line
public function hostManagerActiveList($user_id, $dbh) {
Opening brace should be on a new line
public function TargetList($user_id, $machine_id, $dbh) {
Line indented incorrectly; expected 8 spaces, found 12
try {
No space found after comma in function call
$sql = rtrim($sql,',') . ', PRIMARY KEY (`'.$pk.'`)';
Expected 1 space between comma and argument "$fields"; 0 found
public function CreateDbTable($table,$fields,$dbh)
Expected 1 space between comma and argument "$dbh"; 0 found
public function CreateDbTable($table,$fields,$dbh)
Expected 1 space after closing parenthesis; found 9
foreach($fields as $field => $type)
Expected 1 space after closing parenthesis; found 13
if (preg_match('/AUTO_INCREMENT/i', $type))
Expected 1 space after FOREACH keyword; 0 found
foreach($fields as $field => $type)
The variable $db_name is not named in camelCase.
public function Check()
{
include dirname(__FILE__) . '/../connect.php';
if (!empty($db_host)) {
The variable $db_name is not named in camelCase.
public function Connect()
{
include dirname(__FILE__) . '/../connect.php';
The variable $db_host is not named in camelCase.
public function Check()
{
include dirname(__FILE__) . '/../connect.php';
if (!empty($db_host)) {
The variable $db_pass is not named in camelCase.
public function Check()
{
include dirname(__FILE__) . '/../connect.php';
if (!empty($db_host)) {
The variable $db_name is not named in camelCase.
public function Connect()
{
include dirname(__FILE__) . '/../connect.php';
The variable $db_pass is not named in camelCase.
public function Check()
{
include dirname(__FILE__) . '/../connect.php';
if (!empty($db_host)) {
The variable $db_pass is not named in camelCase.
public function Connect()
{
include dirname(__FILE__) . '/../connect.php';
The variable $db_user is not named in camelCase.
public function Check()
{
include dirname(__FILE__) . '/../connect.php';
if (!empty($db_host)) {
The variable $db_user is not named in camelCase.
public function Connect()
{
include dirname(__FILE__) . '/../connect.php';
The variable $db_name is not named in camelCase.
public function Check()
{
include dirname(__FILE__) . '/../connect.php';
if (!empty($db_host)) {
The variable $db_user is not named in camelCase.
public function Check()
{
include dirname(__FILE__) . '/../connect.php';
if (!empty($db_host)) {
The variable $db_pass is not named in camelCase.
public function Connect()
{
include dirname(__FILE__) . '/../connect.php';
The variable $db_host is not named in camelCase.
public function Connect()
{
include dirname(__FILE__) . '/../connect.php';
The variable $db_host is not named in camelCase.
public function Connect()
{
include dirname(__FILE__) . '/../connect.php';
The variable $db_user is not named in camelCase.
public function Connect()
{
include dirname(__FILE__) . '/../connect.php';
The variable $db_host is not named in camelCase.
public function Check()
{
include dirname(__FILE__) . '/../connect.php';
if (!empty($db_host)) {
The variable $host_manager is not named in camelCase.
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();
The variable $machine_id is not named in camelCase.
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();
The variable $status_id is not named in camelCase.
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);');
The variable $machine_id is not named in camelCase.
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);');
The variable $machine_id is not named in camelCase.
public function targetHostInf($dbh, $target_host, $machine_id)
{
$query = $dbh->prepare('
SELECT * FROM target_host
WHERE ipaddress = :target_host
The variable $machine_id is not named in camelCase.
public function hostManagerDelete($dbh, $machine_id)
{
$query = $dbh->prepare('DELETE FROM manager_host WHERE machine_id = :machine_id ;');
The variable $user_id is not named in camelCase.
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();
The variable $target_host is not named in camelCase.
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);
The variable $machine_id is not named in camelCase.
public function targetHostActive($dbh, $active, $machine_id)
{
$query = $dbh->prepare('UPDATE manager_host SET active=:active WHERE machine_id = :machine_id ;');
The variable $manager_host_id is not named in camelCase.
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);
The variable $pack_sys_id is not named in camelCase.
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);
The variable $task_id is not named in camelCase.
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);
The variable $target_host is not named in camelCase.
public function targetHostInf($dbh, $target_host, $machine_id)
{
$query = $dbh->prepare('
SELECT * FROM target_host
WHERE ipaddress = :target_host
The variable $user_id is not named in camelCase.
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);');
The variable $user_id is not named in camelCase.
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();
The variable $target_host is not named in camelCase.
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();
The variable $pack_sys_id is not named in camelCase.
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);
The variable $status_id is not named in camelCase.
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);');
The variable $machine_id is not named in camelCase.
public function hostManagerActive($dbh, $active, $machine_id)
{
$query = $dbh->prepare('UPDATE manager_host SET active=:active WHERE machine_id = :machine_id ;');
The variable $manager_host_ipaddress is not named in camelCase.
public function hostManagerStatus($dbh, $manager_host_ipaddress, $status)
{
$query = $dbh->prepare('UPDATE manager_host SET status_id=:status_id WHERE ipaddress = :ipaddress ;');
The variable $start_row is not named in camelCase.
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);
The variable $user_id is not named in camelCase.
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);
The variable $user_id is not named in camelCase.
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();
The variable $target_host is not named in camelCase.
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);
The variable $row_in_table is not named in camelCase.
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);
The variable $target_host is not named in camelCase.
public function installedPackageSearch($target_host, $dbh, $search)
{
$search = "%$search%";
$stm = $dbh->prepare('
select * from installed_package
The variable $manager_host_ipaddress is not named in camelCase.
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);
The method Check is not named in camelCase.
public function Check()
{
include dirname(__FILE__) . '/../connect.php';
if (!empty($db_host)) {
The method Connect is not named in camelCase.
public function Connect()
{
include dirname(__FILE__) . '/../connect.php';
The method TargetHostUpdateOS is not named in camelCase.
public function TargetHostUpdateOS($host, $dbh, $os)
{
$query = $dbh->prepare('UPDATE target_host SET os=:os WHERE ipaddress = :ipaddress ;');
The method PackageSearch is not named in camelCase.
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);
The method CreateDbTable is not named in camelCase.
public function CreateDbTable($table,$fields,$dbh)
{
$sql = "CREATE TABLE IF NOT EXISTS `$table` (";
$pk = '';
The method TargetHostRegistration is not named in camelCase.
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);');
The method CountPackage is not named in camelCase.
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);
The method TableCreation is not named in camelCase.
public function TableCreation($dbh)
{
$this->CreateDbTable(
'user_info',
The method PackageList is not named in camelCase.
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);
The method TargetList is not named in camelCase.
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();
The method some_logging_function is not named in camelCase.
public function some_logging_function($log)
{
echo 'LOG : ' . $log . '<br />';
}
There are no issues that match your filters.