edde-framework/edde-framework

View on GitHub

Showing 143 of 143 total issues

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

    class StringUtils extends Object {
        private static $SEPARATOR_LIST = [
            '|',
            ':',
            '.',
Severity: Minor
Found in src/Edde/Common/Strings/StringUtils.php - About 3 hrs to fix

Crate has 27 functions (exceeds 20 allowed). Consider refactoring.
Open

    class Crate extends Object implements ICrate {
        /**
         * @var ISchema
         */
        protected $schema;
Severity: Minor
Found in src/Edde/Common/Crate/Crate.php - About 3 hrs to fix

AbstractNode has 27 functions (exceeds 20 allowed). Consider refactoring.
Open

    abstract class AbstractNode extends Object implements IAbstractNode {
        /**
         * @var IAbstractNode
         */
        protected $parent;
Severity: Minor
Found in src/Edde/Common/Node/AbstractNode.php - About 3 hrs to fix

Method parseTag has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        protected function parseTag(IIterator $iterator, IXmlHandler $xmlHandler) {
            $last = null;
            $name = '';
            $attributeList = [];
            $type = self::XML_TYPE_WARP;
Severity: Major
Found in src/Edde/Common/Xml/XmlParser.php - About 3 hrs to fix

Function node has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

        public function node(INode $node, \Iterator $iterator, ...$parameters) {
            $level = $node->getLevel();
            $stack = new \SplStack();
            /**
             * @var $levelTreeTraversal ITreeTraversal
Severity: Minor
Found in src/Edde/Common/Node/AbstractTreeTraversal.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

Function parse has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

        protected function parse($query) {
            $query = str_replace('//', '/*/', $query);
            $query = '/' . trim($query, '/') . '/';
            $filter = new \stdClass();
            $filter->fixed = strpos($query, '**') === false && strpos($query, '?*') === false;
Severity: Minor
Found in src/Edde/Common/Node/NodeQuery.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

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

    class Property extends Object implements IProperty {
        /**
         * @var ISchema
         */
        protected $schema;
Severity: Minor
Found in src/Edde/Common/Schema/Property.php - About 2 hrs to fix

Function execute has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

        public function execute(): IResponse {
            if ($this->curl === null) {
                throw new ClientException(sprintf('Cannot execute handler for the url [%s] more than once.', (string)$this->request->getRequestUrl()));
            }
            $options = [];
Severity: Minor
Found in src/Edde/Common/Http/Client/HttpHandler.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

Function node has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

        public function node(\Iterator $iterator) {
            $stack = new \SplStack();
            $level = -1;
            /** @var $node INode */
            foreach ($iterator as $node) {
Severity: Minor
Found in src/Edde/Common/Xml/XmlExport.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

File AbstractStaticQueryFactory.php has 270 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
    declare(strict_types=1);

    namespace Edde\Common\Query;

Severity: Minor
Found in src/Edde/Common/Query/AbstractStaticQueryFactory.php - About 2 hrs to fix

Function parseAttribute has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

        protected function parseAttribute(IIterator $iterator) {
            $name = null;
            $open = false;
            $quote = null;
            $value = null;
Severity: Minor
Found in src/Edde/Common/Xml/XmlParser.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

Schema has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

    class Schema extends Object implements ISchema {
        /**
         * @var string
         */
        protected $name;
Severity: Minor
Found in src/Edde/Common/Schema/Schema.php - About 2 hrs to fix

Method node has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        static public function node(INode $root, $source): INode {
            $callback = null;
            if (is_array($source) === false && is_object($source) === false) {
                throw new NodeException('Source must be array or stdClass object.');
            }
Severity: Major
Found in src/Edde/Common/Node/NodeUtils.php - About 2 hrs to fix

Function handleSetup has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

        protected function handleSetup() {
            parent::handleSetup();
            if (empty($this->schemaLoaderList)) {
                throw new SchemaManagerException(sprintf('There are no schema loaders in [%s].', static::class));
            }
Severity: Minor
Found in src/Edde/Common/Schema/SchemaManager.php - About 1 hr 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 load has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

        protected function load(ICrate $crate, array $source) {
            $schema = $crate->getSchema();
            foreach ($source as $property => $value) {
                if ($schema->hasCollection($property = (string)$property)) {
                    $schemaCollection = $schema->getCollection($property);
Severity: Minor
Found in src/Edde/Common/Crate/CrateFactory.php - About 1 hr 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 accept has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        static public function accept(string $accept = null): array {
            if ($accept === null) {
                return ['*/*'];
            }
            $accepts = [];
Severity: Minor
Found in src/Edde/Common/Http/HttpUtils.php - About 1 hr to fix

Method parse has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        protected function parse($query) {
            $query = str_replace('//', '/*/', $query);
            $query = '/' . trim($query, '/') . '/';
            $filter = new \stdClass();
            $filter->fixed = strpos($query, '**') === false && strpos($query, '?*') === false;
Severity: Minor
Found in src/Edde/Common/Node/NodeQuery.php - About 1 hr to fix

Function getMethodReflection has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

        static public function getMethodReflection($callback) {
            if (is_string($callback) && class_exists($callback)) {
                $reflectionClass = self::getReflectionClass($callback);
                if ($constructor = $reflectionClass->getConstructor()) {
                    return $constructor;
Severity: Minor
Found in src/Edde/Common/Reflection/ReflectionUtils.php - About 1 hr 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 compile has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public function compile(IResourceList $resourceList = null): IFile {
            $content = [];
            $pathList = [];
            $resourceList = $resourceList ?: $this;
            $cache = $this->cache();
Severity: Minor
Found in src/Edde/Common/Web/StyleSheetCompiler.php - About 1 hr to fix

Method parseAttribute has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        protected function parseAttribute(IIterator $iterator) {
            $name = null;
            $open = false;
            $quote = null;
            $value = null;
Severity: Minor
Found in src/Edde/Common/Xml/XmlParser.php - About 1 hr to fix
Severity
Category
Status
Source
Language