Showing 587 of 587 total issues
Function handleRemoteCall
has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring. Open
public function handleRemoteCall() {
header("Access-Control-Allow-Headers: *");
header("Access-Control-Allow-Origin: *");
- Read upRead up
- Create a ticketCreate a ticket
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"
Further reading
File MDatabaseDatastore.php
has 582 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace webfilesframework\core\datastore\types\database;
use Exception;
- Create a ticketCreate a ticket
Function getWebfilesByTablename
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
private function getWebfilesByTablename($tableName,$className = null,$condition = null,$order = null)
{
$webfileArray = array();
- Read upRead up
- Create a ticketCreate a ticket
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"
Further reading
Function getDatatypeFromAttributeName
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
public static function getDatatypeFromAttributeName($attributeName)
{
$typeIdentifier = self::getTypeIdentifier($attributeName);
if ($typeIdentifier == "s") {
- Read upRead up
- Create a ticketCreate a ticket
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"
Further reading
Function getFormItemByAttributeType
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public static function getFormItemByAttributeType($attributeType, $attributeName, $attributeValue = "", $localizedName = "")
{
if ($attributeType == "integer") {
$formItem = new MTextfieldFormItem($attributeName, $attributeValue, $localizedName);
- Read upRead up
- Create a ticketCreate a ticket
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"
Further reading
Function store
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
private function store(MWebfile $webfile, $useOnlySimpleDatatypes = false)
{
$tablename = $this->resolveTableNameForWebfile($webfile);
- Read upRead up
- Create a ticketCreate a ticket
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"
Further reading
Function update
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
private function update(MWebfile $webfile, $useOnlySimpleDatatypes = false)
{
$oAttributeArray = $webfile->getAttributes();
- Read upRead up
- Create a ticketCreate a ticket
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"
Further reading
MDatabaseDatastore
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class MDatabaseDatastore extends MAbstractDatastore
implements MISingleDatasourceDatastore
{
private $databaseConnection;
- Create a ticketCreate a ticket
File MWebfile.php
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace webfilesframework\core\datasystem\file\format;
use ReflectionClass;
use ReflectionException;
- Create a ticketCreate a ticket
Function getFormItemByAttributeName
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public static function getFormItemByAttributeName($attributeName, $attributeValue, $localizedName = "")
{
$attributeType = substr($attributeName, 2, 1);
- Read upRead up
- Create a ticketCreate a ticket
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"
Further reading
Function createTableColumnFromAttributeName
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
private function createTableColumnFromAttributeName($sAttributeName)
{
$prefix = substr($sAttributeName, 2, 1);
if ($prefix == "s") { // string (width = 50)
return new MDatabaseTableColumn(
- Read upRead up
- Create a ticketCreate a ticket
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"
Further reading
Function translateTemplateIntoCondition
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
private function translateTemplateIntoCondition(MWebfile $webfile)
{
$first = true;
$condition = "";
- Read upRead up
- Create a ticketCreate a ticket
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"
Further reading
Method handleRemoteCall
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleRemoteCall() {
header("Access-Control-Allow-Headers: *");
header("Access-Control-Allow-Origin: *");
- Create a ticketCreate a ticket
The class MDirectoryDatastore has an overall complexity of 62 which is very high. The configured complexity threshold is 50. Open
class MDirectoryDatastore extends MAbstractCachableDatastore
implements MISingleDatasourceDatastore
{
/** @var MDirectory */
- Create a ticketCreate a ticket
- Exclude checks
The class MImage has 16 public methods. Consider refactoring MImage to keep number of public methods under 10. Open
class MImage extends MFile
{
protected $m_oImage;
- Read upRead up
- Create a ticketCreate a ticket
- 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
The class MDatabaseDatastore has 27 non-getter- and setter-methods. Consider refactoring MDatabaseDatastore to keep number of methods under 25. Open
class MDatabaseDatastore extends MAbstractDatastore
implements MISingleDatasourceDatastore
{
private $databaseConnection;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
TooManyMethods
Since: 0.1
A class with too many 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'.
The default was changed from 10 to 25 in PHPMD 2.3.
Example
Source https://phpmd.org/rules/codesize.html#toomanymethods
The class MDatabaseDatastore has an overall complexity of 121 which is very high. The configured complexity threshold is 50. Open
class MDatabaseDatastore extends MAbstractDatastore
implements MISingleDatasourceDatastore
{
private $databaseConnection;
- Create a ticketCreate a ticket
- Exclude checks
MWebfile
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class MWebfile {
protected $m_iId = 0;
/**
- Create a ticketCreate a ticket
The class MImage has an overall complexity of 51 which is very high. The configured complexity threshold is 50. Open
class MImage extends MFile
{
protected $m_oImage;
- Create a ticketCreate a ticket
- Exclude checks
The class MWebfile has an overall complexity of 80 which is very high. The configured complexity threshold is 50. Open
class MWebfile {
protected $m_iId = 0;
/**
- Create a ticketCreate a ticket
- Exclude checks