Showing 10 of 10 total issues
The class Oci8Statement has 13 public methods. Consider refactoring Oci8Statement to keep number of public methods under 10. Open
Open
class Oci8Statement extends AbstractOci8Base implements Oci8StatementInterface
{
/** @var resource */
protected $resource;
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
Oci8Connection
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Oci8Connection extends AbstractOci8Base implements Oci8ConnectionInterface
{
/**
* Connection constructor.
* @param $username
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function __construct($name, $value, $size, $precision, $scale, $type, $rawType)
Method bindArrayByName
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function bindArrayByName($name, &$varArray, $maxTableLength, $maxItemLength = -1, $type = SQLT_AFC)
Method bindArrayByName
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function bindArrayByName($name, &$varArray, $maxTableLength, $maxItemLength = -1, $type = SQLT_AFC);
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$username,
$password,
$connectionString = null,
$characterSet = null,
$sessionMode = null
Method connect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$username,
$password,
$connectionString = null,
$characterSet = null,
$sessionMode = null
Method connect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$username,
$password,
$connectionString = null,
$characterSet = null,
$sessionMode = null
Method connect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$username,
$password = null,
$connectionString = null,
$characterSet = null,
$sessionMode = 0
Function getErrorHandler
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
protected static function getErrorHandler()
{
if (!static::$errorHandler) {
static::$errorHandler = function ($severity, $message, $file = '', $line = 0) {
restore_error_handler();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"