sebastianmonzel/webfiles-framework-php

View on GitHub

Showing 80 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: *");

Severity: Minor
Found in source/core/datastore/types/remote/MRemoteDatastoreEndpoint.php - About 1 day to fix

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;
Severity: Major
Found in source/core/datastore/types/database/MDatabaseDatastore.php - About 1 day to fix

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();


Severity: Minor
Found in source/core/datastore/types/database/MDatabaseDatastore.php - About 6 hrs to fix

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") {
Severity: Minor
Found in source/core/datasystem/file/format/MWebfile.php - About 6 hrs to fix

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);
Severity: Minor
Found in source/io/form/MFormItemFactory.php - About 5 hrs to fix

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);

Severity: Minor
Found in source/core/datastore/types/database/MDatabaseDatastore.php - About 4 hrs to fix

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();

Severity: Minor
Found in source/core/datastore/types/database/MDatabaseDatastore.php - About 4 hrs to fix

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;
Severity: Minor
Found in source/core/datastore/types/database/MDatabaseDatastore.php - About 4 hrs to fix

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;
Severity: Minor
Found in source/core/datasystem/file/format/MWebfile.php - About 4 hrs to fix

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);

Severity: Minor
Found in source/io/form/MFormItemFactory.php - About 3 hrs to fix

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(
Severity: Minor
Found in source/core/datastore/types/database/MDatabaseDatastore.php - About 3 hrs to fix

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 = "";
Severity: Minor
Found in source/core/datastore/types/database/MDatabaseDatastore.php - About 3 hrs to fix

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: *");

Severity: Major
Found in source/core/datastore/types/remote/MRemoteDatastoreEndpoint.php - About 3 hrs to fix

MWebfile has 28 functions (exceeds 20 allowed). Consider refactoring.
Open

class MWebfile {

    protected $m_iId = 0;

    /**
Severity: Minor
Found in source/core/datasystem/file/format/MWebfile.php - About 3 hrs to fix

Function syncToLocalDirectory has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function syncToLocalDirectory(MDirectory $directory, $recursivly, $folder)
    {

        //var_dump($folder);
Severity: Minor
Found in source/core/datasystem/file/system/dropbox/MDropboxDirectory.php - About 3 hrs to fix

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 init has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function init($useLabel = true)
    {

        $this->code = "";

Severity: Minor
Found in source/io/form/formItem/MDropdownMenueFormItem.php - About 2 hrs to fix

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

MDirectoryDatastore has 25 functions (exceeds 20 allowed). Consider refactoring.
Open

class MDirectoryDatastore extends MAbstractCachableDatastore
    implements MISingleDatasourceDatastore
{

    /** @var MDirectory */
Severity: Minor
Found in source/core/datastore/types/directory/MDirectoryDatastore.php - About 2 hrs to fix

Method init has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function init($useLabel = true)
    {

        $this->code = "";

Severity: Major
Found in source/io/form/formItem/MDropdownMenueFormItem.php - About 2 hrs to fix

MImage has 24 functions (exceeds 20 allowed). Consider refactoring.
Open

class MImage extends MFile
{

    protected $m_oImage;

Severity: Minor
Found in source/core/datasystem/file/format/media/image/MImage.php - About 2 hrs to fix

MMail has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

class MMail extends MWebfile
{

    private $m_sFrom;
    private $m_sTo;
Severity: Minor
Found in source/core/datastore/types/mail/MMail.php - About 2 hrs to fix
Severity
Category
Status
Source
Language