GemsTracker/gemstracker-library

View on GitHub
classes/Gems/Condition/Track/AgeCondition.php

Summary

Maintainability
A
1 hr
Test Coverage
F
43%

Method getModelFields has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getModelFields($context, $new)
    {
        $compareOptions = [
            'NOW' => $this->_('Now (actual current time)'),
            'TS' => $this->_('At track start data'),
Severity: Minor
Found in classes/Gems/Condition/Track/AgeCondition.php - About 1 hr to fix

    Avoid unused local variables such as '$maxAge'.
    Open

            $maxAge  = $this->_data['gcon_condition_text4'];

    UnusedLocalVariable

    Since: 0.2

    Detects when a local variable is declared and/or assigned, but not used.

    Example

    class Foo {
        public function doSomething()
        {
            $i = 5; // Unused
        }
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

    Avoid unused parameters such as '$fieldData'.
    Open

        public function isTrackValid(\Gems_Tracker_RespondentTrack $respTrack, array $fieldData = null)

    UnusedFormalParameter

    Since: 0.2

    Avoid passing parameters to methods or constructors and then not using those parameters.

    Example

    class Foo
    {
        private function bar($howdy)
        {
            // $howdy is not used
        }
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

    Avoid unused local variables such as '$minAge'.
    Open

            $minAge  = $this->_data['gcon_condition_text2'];

    UnusedLocalVariable

    Since: 0.2

    Detects when a local variable is declared and/or assigned, but not used.

    Example

    class Foo {
        public function doSomething()
        {
            $i = 5; // Unused
        }
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

    There are no issues that match your filters.

    Category
    Status