qcubed/framework

View on GitHub
assets/php/_devtools/jquery_ui_gen/jq_control_gen-1.10.php

Summary

Maintainability
F
1 wk
Test Coverage

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

    public function __construct($strUrl, $strJqClass = null, $strJqSetupFunc = null, $strQcClass = null, $strQcBaseClass = 'QPanel')
Severity: Minor
Found in assets/php/_devtools/jquery_ui_gen/jq_control_gen-1.10.php - About 35 mins to fix

    Function __construct has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function __construct($strUrl, $strJqClass = null, $strJqSetupFunc = null, $strQcClass = null, $strQcBaseClass = 'QPanel')
        {
            $this->hasDisabledProperty = false;
            $html = file_get_html($strUrl);
    
    
    Severity: Minor
    Found in assets/php/_devtools/jquery_ui_gen/jq_control_gen-1.10.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

    Missing class import via use statement (line '87', column '26').
    Open

            $this->options[] = new Option($name, $origName, $type, $defaultValue, $description);

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '173', column '22').
    Open

        $jqControlGen = new JqControlGen();

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '117', column '26').
    Open

                $this->events[] = new Event($this->strQcClass, $name, $origName, $type, $description);

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '140', column '26').
    Open

            $this->methods[] = new Method($name, $origName, $signature, $description);

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '174', column '18').
    Open

        $objJqDoc = new HtmlJqDoc($strUrl, null, null, $strQcClass, $strQcBaseClass);

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '115', column '27').
    Open

                $this->options[] = new Event($this->strQcClass, $name, $origName, $type, $description);

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    The method add_option uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                $desc_node = $name_node->next_sibling();
            }

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    The method CamelCaseFromDash uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                $strToReturn .= substr($strName, 0, $intPosition);
                $strName = substr($strName, $intPosition + 1);
            }

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    The method add_event uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                $this->events[] = new Event($this->strQcClass, $name, $origName, $type, $description);
            }

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    <?php
    require('jq_control.php');
        require('qcubed.inc.php');
    
    class HtmlJqDoc extends JqDoc {
    Severity: Major
    Found in assets/php/_devtools/jquery_ui_gen/jq_control_gen-1.10.php and 1 other location - About 1 wk to fix
    assets/php/_devtools/jquery_ui_gen/jq_control_gen-v1.9.php on lines 1..265

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 2334.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    The parameter $desc_node is not named in camelCase.
    Open

        public function description($desc_node) {
            $description = '';
            while ($desc_node) {
                if (strpos($desc_node->plaintext, 'Code examples:') !== false) {
                    break;

    CamelCaseParameterName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name parameters.

    Example

    class ClassName {
        public function doSomething($user_name) {
        }
    }

    Source

    The variable $desc_node is not named in camelCase.
    Open

        public function add_option($htmlOption) {
            $nodes = $htmlOption->find('h3');
            $name_node = $nodes[0];
            $origName = $name = preg_replace('/\W.*/', '', $name_node->innertext());
    
    

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $name_node is not named in camelCase.
    Open

        public function add_option($htmlOption) {
            $nodes = $htmlOption->find('h3');
            $name_node = $nodes[0];
            $origName = $name = preg_replace('/\W.*/', '', $name_node->innertext());
    
    

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $desc_node is not named in camelCase.
    Open

        public function add_event($htmlEvent, $type = null) {
            $nodes = $htmlEvent->find('h3');
            $name_node = $nodes[0];
            $origName = $name = preg_replace('/\W.*/', '', $name_node->innertext());
            if (substr($name, 0, 2) !== "on") {

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $desc_node is not named in camelCase.
    Open

        public function description($desc_node) {
            $description = '';
            while ($desc_node) {
                if (strpos($desc_node->plaintext, 'Code examples:') !== false) {
                    break;

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $name_node is not named in camelCase.
    Open

        public function add_option($htmlOption) {
            $nodes = $htmlOption->find('h3');
            $name_node = $nodes[0];
            $origName = $name = preg_replace('/\W.*/', '', $name_node->innertext());
    
    

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $desc_node is not named in camelCase.
    Open

        public function add_option($htmlOption) {
            $nodes = $htmlOption->find('h3');
            $name_node = $nodes[0];
            $origName = $name = preg_replace('/\W.*/', '', $name_node->innertext());
    
    

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $desc_node is not named in camelCase.
    Open

        public function description($desc_node) {
            $description = '';
            while ($desc_node) {
                if (strpos($desc_node->plaintext, 'Code examples:') !== false) {
                    break;

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $name_node is not named in camelCase.
    Open

        public function add_option($htmlOption) {
            $nodes = $htmlOption->find('h3');
            $name_node = $nodes[0];
            $origName = $name = preg_replace('/\W.*/', '', $name_node->innertext());
    
    

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $desc_node is not named in camelCase.
    Open

        public function description($desc_node) {
            $description = '';
            while ($desc_node) {
                if (strpos($desc_node->plaintext, 'Code examples:') !== false) {
                    break;

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $name_node is not named in camelCase.
    Open

        public function add_event($htmlEvent, $type = null) {
            $nodes = $htmlEvent->find('h3');
            $name_node = $nodes[0];
            $origName = $name = preg_replace('/\W.*/', '', $name_node->innertext());
            if (substr($name, 0, 2) !== "on") {

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $name_node is not named in camelCase.
    Open

        public function add_method($htmlMethod) {
            $nodes = $htmlMethod->find('h3');
            $name_node = $nodes[0];
            $origName = $name = preg_replace('/\W.*/', '', $name_node->innertext());
            if ($origName === "widget") {

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $name_node is not named in camelCase.
    Open

        public function add_event($htmlEvent, $type = null) {
            $nodes = $htmlEvent->find('h3');
            $name_node = $nodes[0];
            $origName = $name = preg_replace('/\W.*/', '', $name_node->innertext());
            if (substr($name, 0, 2) !== "on") {

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $name_node is not named in camelCase.
    Open

        public function add_method($htmlMethod) {
            $nodes = $htmlMethod->find('h3');
            $name_node = $nodes[0];
            $origName = $name = preg_replace('/\W.*/', '', $name_node->innertext());
            if ($origName === "widget") {

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $desc_node is not named in camelCase.
    Open

        public function add_method($htmlMethod) {
            $nodes = $htmlMethod->find('h3');
            $name_node = $nodes[0];
            $origName = $name = preg_replace('/\W.*/', '', $name_node->innertext());
            if ($origName === "widget") {

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $desc_node is not named in camelCase.
    Open

        public function add_event($htmlEvent, $type = null) {
            $nodes = $htmlEvent->find('h3');
            $name_node = $nodes[0];
            $origName = $name = preg_replace('/\W.*/', '', $name_node->innertext());
            if (substr($name, 0, 2) !== "on") {

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $desc_node is not named in camelCase.
    Open

        public function add_method($htmlMethod) {
            $nodes = $htmlMethod->find('h3');
            $name_node = $nodes[0];
            $origName = $name = preg_replace('/\W.*/', '', $name_node->innertext());
            if ($origName === "widget") {

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $desc_node is not named in camelCase.
    Open

        public function description($desc_node) {
            $description = '';
            while ($desc_node) {
                if (strpos($desc_node->plaintext, 'Code examples:') !== false) {
                    break;

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $desc_node is not named in camelCase.
    Open

        public function description($desc_node) {
            $description = '';
            while ($desc_node) {
                if (strpos($desc_node->plaintext, 'Code examples:') !== false) {
                    break;

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $desc_node is not named in camelCase.
    Open

        public function add_option($htmlOption) {
            $nodes = $htmlOption->find('h3');
            $name_node = $nodes[0];
            $origName = $name = preg_replace('/\W.*/', '', $name_node->innertext());
    
    

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $name_node is not named in camelCase.
    Open

        public function add_event($htmlEvent, $type = null) {
            $nodes = $htmlEvent->find('h3');
            $name_node = $nodes[0];
            $origName = $name = preg_replace('/\W.*/', '', $name_node->innertext());
            if (substr($name, 0, 2) !== "on") {

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $name_node is not named in camelCase.
    Open

        public function add_method($htmlMethod) {
            $nodes = $htmlMethod->find('h3');
            $name_node = $nodes[0];
            $origName = $name = preg_replace('/\W.*/', '', $name_node->innertext());
            if ($origName === "widget") {

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $name_node is not named in camelCase.
    Open

        public function add_method($htmlMethod) {
            $nodes = $htmlMethod->find('h3');
            $name_node = $nodes[0];
            $origName = $name = preg_replace('/\W.*/', '', $name_node->innertext());
            if ($origName === "widget") {

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The method add_event is not named in camelCase.
    Open

        public function add_event($htmlEvent, $type = null) {
            $nodes = $htmlEvent->find('h3');
            $name_node = $nodes[0];
            $origName = $name = preg_replace('/\W.*/', '', $name_node->innertext());
            if (substr($name, 0, 2) !== "on") {

    CamelCaseMethodName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name methods.

    Example

    class ClassName {
        public function get_name() {
        }
    }

    Source

    The method is_event_option is not named in camelCase.
    Open

        public function is_event_option($type) {
            return stripos($type, 'function') !== false && strpos($type, ' or ') === false;
        }

    CamelCaseMethodName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name methods.

    Example

    class ClassName {
        public function get_name() {
        }
    }

    Source

    The method add_method is not named in camelCase.
    Open

        public function add_method($htmlMethod) {
            $nodes = $htmlMethod->find('h3');
            $name_node = $nodes[0];
            $origName = $name = preg_replace('/\W.*/', '', $name_node->innertext());
            if ($origName === "widget") {

    CamelCaseMethodName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name methods.

    Example

    class ClassName {
        public function get_name() {
        }
    }

    Source

    The method add_option is not named in camelCase.
    Open

        public function add_option($htmlOption) {
            $nodes = $htmlOption->find('h3');
            $name_node = $nodes[0];
            $origName = $name = preg_replace('/\W.*/', '', $name_node->innertext());
    
    

    CamelCaseMethodName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name methods.

    Example

    class ClassName {
        public function get_name() {
        }
    }

    Source

    There are no issues that match your filters.

    Category
    Status