taviroquai/duality

View on GitHub

Showing 30 of 38 total issues

Method getSelect has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $fields, $from, $where = '', $groupby = '', $limit = 0, $offset = 0
Severity: Minor
Found in src/Duality/Service/Database.php - About 45 mins to fix

    Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $key, $value, $filters, $pass = '', $fail = ''
    Severity: Minor
    Found in src/Duality/Structure/RuleItem.php - About 35 mins to fix

      Method find has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $offset = 0, $limit = 10, $where = '', $values = array(), $select = '*'
      Severity: Minor
      Found in src/Duality/Structure/Database/Table.php - About 35 mins to fix

        Function listen has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function listen()
            {
                $notfound = true;
                foreach ($this->responders as $ns => $cb) {
                    foreach ($this->argv as $item) {
        Severity: Minor
        Found in src/Duality/Service/Commander.php - About 35 mins 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 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function load(\Closure $callback = null)
            {
                if (is_resource($this->handler) && filesize($this->getPath()) > 0) {
                    rewind($this->handler);
                    $length = filesize($this->getPath()) < 4096 ? 
        Severity: Minor
        Found in src/Duality/Structure/File/StreamFile.php - About 35 mins 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 reloadFromConfig has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function reloadFromConfig($config)
            {
                $this->schema = $config;
                if (!isset($this->schema['create'])) {
                    $this->schema['create'] = array();
        Severity: Minor
        Found in src/Duality/Service/Database.php - About 25 mins 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 encrypt has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function encrypt($data)
            {
                // Set defaults
                $algo = 'sha256';
                $salt = '';
        Severity: Minor
        Found in src/Duality/Service/Security.php - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function init()
            {
                if (!extension_loaded('intl')) {
                    throw new DualityException(
                        "Error: intl extension not loaded",
        Severity: Minor
        Found in src/Duality/Service/Localization.php - About 25 mins 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 __construct has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function __construct(Database $db)
            {
                $this->properties = new Storage;
                if (!empty($this->config['name'])) {
                    $this->setName($this->config['name']);
        Severity: Minor
        Found in src/Duality/Structure/Entity.php - About 25 mins 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 importArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function importArray($data)
            {
                foreach ($data as $key => $item) {
                    $row = new TableRow($this);
                    foreach ($this->getColumns() as $col => $prop) {
        Severity: Minor
        Found in src/Duality/Structure/Table.php - About 25 mins 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

        Severity
        Category
        Status
        Source
        Language