oliver-schoendorn/local-captcha

View on GitHub

Showing 5 of 5 total issues

Function LocalCaptcha has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    window.LocalCaptcha = (function() {
        var _documentReady = document.readyState === 'complete'
        var _onLoadCallback = function() {};

        if ( ! _documentReady) {
Severity: Minor
Found in src/View/LocalCaptcha.js - About 1 hr to fix

    Function LocalCaptcha has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        window.LocalCaptcha = (function() {
            var _documentReady = document.readyState === 'complete'
            var _onLoadCallback = function() {};
    
            if ( ! _documentReady) {
    Severity: Minor
    Found in src/View/LocalCaptcha.js - About 55 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 attributesToHTML has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        private function attributesToHTML(): string
        {
            $attributes = [];
            foreach ($this->getAttributes() as $attributeKey => $attributeValue) {
                if (is_array($attributeValue)) {
    Severity: Minor
    Found in src/View/InputField.php - About 45 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 addToStyles has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function addToStyles(array &$attributes, string $key, $value)
        {
            if ( ! array_key_exists('style', $attributes)) {
                $attributes['style'] = [ $key => $value ];
            }
    Severity: Minor
    Found in src/View/Honeypot/AbstractHoneypotInput.php - About 45 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

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

            string $name,
            $value = '',
            string $type = 'text',
            array $attributes = [],
            string $javascript = null
    Severity: Minor
    Found in src/View/Honeypot/AbstractHoneypotInput.php - About 35 mins to fix
      Severity
      Category
      Status
      Source
      Language