| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 28 | 2 | 6 | 0.991 | statement_sequence[11] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 28 | 55 | administrator/components/com_users/models/groups.php |
| 2 | 28 | 55 | administrator/components/com_users/models/levels.php |
| ||||
// If the model is set to check item state, add to the query.
if ($this->getState('check.state', TRUE)) {
//$query->where('a.block = ' . (int)$this->getState('filter.state'));
}
// Filter the items over the parent id if set.
$parent_id= $this->getState('filter.parent_id');
if ($parent_id !== NULL
&& $parent_id> 0) {
$query->join('LEFT', '`#__usergroups` AS p ON p.id = '
. (int) $parent_id);
$query->where('a.lft > p.lft AND a.rgt < p.rgt');
}
// Filter the items over the section id if set.
$sectionId= $this->getState('filter.section_id');
if ($sectionId !== NULL
&& $sectionId> 0) {
$query->where('a.section_id = '
. (int) $sectionId);
}
// Filter the comments over the search string if set.
$search= $this->getState('filter.search');
if (!empty($search)) {
$query->where('a.title LIKE '
. $this->_db->Quote('%'
. $search
. '%'));
}
// Join on the access control system
$query->select('GROUP_CONCAT(DISTINCT(act.title) SEPARATOR \',\') AS actions');
$query->leftJoin('#__usergroup_rule_map AS ugrm ON ugrm.group_id = a.id');
$query->leftJoin('#__access_rules AS r ON r.id = ugrm.rule_id AND r.access_type = 1');
$query->leftJoin('#__access_action_rule_map AS arm ON arm.rule_id = r.id ');
|
| ||||
// If the model is set to check item state, add to the query.
if ($this->getState('check.state', TRUE)) {
//$query->where('a.block = ' . (int)$this->getState('filter.state'));
}
// Filter the items over the parent id if set.
$parent_id= $this->getState('filter.parent_id');
if ($parent_id !== NULL
&& $parent_id> 0) {
$query->join('LEFT', '`#__access_assetgroups` AS p ON p.id = '
. (int) $parent_id);
$query->where('a.lft > p.lft AND a.rgt < p.rgt');
}
// Filter the items over the section id if set.
$sectionId= $this->getState('filter.section_id');
if ($sectionId !== NULL
&& $sectionId> 0) {
$query->where('a.section_id = '
. (int) $sectionId);
}
// Filter the items over the search string if set.
$search= $this->getState('filter.search');
if (!empty($search)) {
$query->where('a.title LIKE '
. $this->_db->Quote('%'
. $search
. '%'));
}
// Extended joins to get a list of user groups associated with an access level.
$query->select('GROUP_CONCAT(DISTINCT ug2.title ORDER BY ug2.lft ASC SEPARATOR \',\') AS user_groups');
$query->leftJoin('#__access_assetgroup_rule_map AS agrm ON agrm.group_id = a.id');
$query->innerJoin('#__access_rules AS r ON r.id = agrm.rule_id');
$query->leftJoin('#__usergroup_rule_map AS ugrm ON ugrm.rule_id = r.id');
|
| |||
// If the model is set to check item state, add to the query.
if ($this->getState('check.state',TRUE)) {
//$query->where('a.block = ' . (int)$this->getState('filter.state'));
}
// Filter the items over the parent id if set.
$parent_id=$this->getState('filter.parent_id');
if ($parent_id !== NULL
&& $parent_id>0) {
$query->join('LEFT', [[#variable53d8d2a0]]
. (int) $parent_id);
$query->where('a.lft > p.lft AND a.rgt < p.rgt');
}
// Filter the items over the section id if set.
$sectionId=$this->getState('filter.section_id');
if ($sectionId !== NULL
&& $sectionId>0) {
$query->where('a.section_id = '
. (int) $sectionId);
}
// Filter the comments over the search string if set.
// Filter the items over the search string if set.
$search=$this->getState('filter.search');
if (!empty($search)) {
$query->where('a.title LIKE '
. $this->_db->Quote('%'
. $search
. '%'));
}
// Join on the access control system
// Extended joins to get a list of user groups associated with an access level.
$query->select( [[#variable53d8d220]]);
$query->leftJoin( [[#variable53d8d160]]);
$query-> [[#variable53d8d120]]( [[#variable53d8d060]]);
$query->leftJoin( [[#variable53d8d020]]);
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#53d8d2a0]] | '`#__usergroups` AS p ON p.id = ' |
| 1 | 2 | [[#53d8d2a0]] | '`#__access_assetgroups` AS p ON p.id = ' |
| 2 | 1 | [[#53d8d220]] | 'GROUP_CONCAT(DISTINCT(act.title) SEPARATOR \',\') AS actions' |
| 2 | 2 | [[#53d8d220]] | 'GROUP_CONCAT(DISTINCT ug2.title ORDER BY ug2.lft ASC SEPARATOR \',\') AS user_groups' |
| 3 | 1 | [[#53d8d160]] | '#__usergroup_rule_map AS ugrm ON ugrm.group_id = a.id' |
| 3 | 2 | [[#53d8d160]] | '#__access_assetgroup_rule_map AS agrm ON agrm.group_id = a.id' |
| 4 | 1 | [[#53d8d120]] | leftJoin |
| 4 | 2 | [[#53d8d120]] | innerJoin |
| 5 | 1 | [[#53d8d060]] | '#__access_rules AS r ON r.id = ugrm.rule_id AND r.access_type = 1' |
| 5 | 2 | [[#53d8d060]] | '#__access_rules AS r ON r.id = agrm.rule_id' |
| 6 | 1 | [[#53d8d020]] | '#__access_action_rule_map AS arm ON arm.rule_id = r.id ' |
| 6 | 2 | [[#53d8d020]] | '#__usergroup_rule_map AS ugrm ON ugrm.rule_id = r.id' |