GemsTracker/gemstracker-library

View on GitHub

Showing 4,260 of 4,272 total issues

Gems_Tracker_RespondentTrack has 65 functions (exceeds 20 allowed). Consider refactoring.
Open

class Gems_Tracker_RespondentTrack extends \Gems_Registry_TargetAbstract
{
    use DbTranslateUtilTrait;
    
    /**
Severity: Major
Found in classes/Gems/Tracker/RespondentTrack.php - About 1 day to fix

    File Tracker.php has 551 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     *
     * @package    Gems
    Severity: Major
    Found in classes/Gems/Tracker.php - About 1 day to fix

      File TrafficLightTokenSnippet.php has 544 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /**
       *
       * @package    Gems
      Severity: Major
      Found in classes/Gems/Snippets/Respondent/TrafficLightTokenSnippet.php - About 1 day to fix

        Function routeShutdown has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
        Open

            public function routeShutdown(\Zend_Controller_Request_Abstract $request)
            {
                $loader = $this->getLoader();
        
                // Load the menu. As building the menu can depend on all resources and the request, we do it here.
        Severity: Minor
        Found in classes/GemsEscort.php - About 1 day 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

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

        <?php
        
        /**
         *
         * @package    Gems
        Severity: Major
        Found in classes/Gems/Agenda/Filter/LocationAppointmentFilter.php and 1 other location - About 1 day to fix
        classes/Gems/Agenda/Filter/WithAppointmentFilter.php on lines 1..107

        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 259.

        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

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

        <?php
        
        /**
         *
         * @package    Gems
        Severity: Major
        Found in classes/Gems/Agenda/Filter/WithAppointmentFilter.php and 1 other location - About 1 day to fix
        classes/Gems/Agenda/Filter/LocationAppointmentFilter.php on lines 1..107

        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 259.

        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

        Function resetpasswordAction has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
        Open

            public function resetpasswordAction()
            {
                $errors  = array();
                $form    = $this->createResetRequestForm();
                $request = $this->getRequest();
        Severity: Minor
        Found in classes/Gems/Default/IndexAction.php - About 1 day 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 RespondentNewAction.php has 516 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        /**
         *
         * @package    Gems
        Severity: Major
        Found in classes/Gems/Default/RespondentNewAction.php - About 1 day to fix

          File StreamingStataExport.php has 507 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          namespace Gems\Export;
          
          use XMLWriter;
          Severity: Major
          Found in classes/Gems/Export/StreamingStataExport.php - About 1 day to fix

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

                public function unsubscribeAction()
                {
                    $orgId = urldecode($this->getRequest()->getParam('org'));
            
                    if ($orgId && ($orgId != $this->currentUser->getCurrentOrganizationId())) {
            Severity: Major
            Found in classes/Gems/Default/ParticipateAction.php and 1 other location - About 1 day to fix
            classes/Gems/Default/ParticipateAction.php on lines 131..165

            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 247.

            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

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

                public function subscribeAction()
                {
                    $orgId = urldecode($this->getRequest()->getParam('org'));
            
                    if ($orgId && ($orgId != $this->currentUser->getCurrentOrganizationId())) {
            Severity: Major
            Found in classes/Gems/Default/ParticipateAction.php and 1 other location - About 1 day to fix
            classes/Gems/Default/ParticipateAction.php on lines 186..220

            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 247.

            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

            Function applyToModel has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
            Open

                public function applyToModel(\MUtil_Model_ModelAbstract $model)
                {
                    $map    = $this->_getMap();
                    $oldfld = null;
                    $parent = null;
            Severity: Minor
            Found in classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php - About 1 day 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 _format has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
            Open

                private function _format($name, $result, $model)
                {
                    static $view = null;
            
                    if (!isset($this->_options[$name])) {
            Severity: Minor
            Found in classes/Gems/FormattedData.php - About 1 day 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 execute has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
            Open

                public function execute($row = null,
                        $noToken = \Gems_Model_Translator_AnswerTranslatorAbstract::TOKEN_ERROR,
                        $tokenCompletion = \Gems_Model_Translator_AnswerTranslatorAbstract::TOKEN_ERROR)
                {
                    // \MUtil_Echo::track($row);
            Severity: Minor
            Found in classes/Gems/Task/Import/SaveAnswerTask.php - About 1 day 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 calculateFieldValue has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
            Open

                public function calculateFieldValue($currentValue, array $fieldData, array $trackData)
                {
                    if ($currentValue || isset($this->_fieldDefinition['gtf_filter_id'])) {
                        $agenda = $this->loader->getAgenda();
            
            
            Severity: Minor
            Found in classes/Gems/Tracker/Field/AppointmentField.php - About 7 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 createMenuLinks has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function createMenuLinks($includeLevel = 2, $parentLabel = true)
                {
                    if ($currentItem  = $this->menu->getCurrent()) {
                        $links        = array();
                        $childItems   = $currentItem->getChildren();
            Severity: Minor
            Found in classes/Gems/Controller/ModelActionAbstract.php - About 7 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 createMenuLinks has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function createMenuLinks($includeLevel = 2, $parentLabel = true)
                {
                    if ($currentItem  = $this->menu->getCurrent()) {
                        $links        = array();
                        $childItems   = $currentItem->getChildren();
            Severity: Minor
            Found in classes/Gems/Default/DatabaseAction.php - About 7 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

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

                protected function _getQuestionAttribute($qid, $attribute, $default = null)
                {
                    if (! is_array($this->_attributes)) {
                        $this->_attributes = [];
                        $attributesTable  = $this->_getQuestionAttributesTableName();
            Severity: Major
            Found in classes/Gems/Tracker/Source/LimeSurvey4m00FieldMap.php and 1 other location - About 7 hrs to fix
            classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php on lines 516..546

            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 242.

            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

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

                protected function _getQuestionAttribute($qid, $attribute, $default = null)
                {
                    if (! is_array($this->_attributes)) {
                        $this->_attributes = [];
                        $attributesTable  = $this->_getQuestionAttributesTableName();
            Severity: Major
            Found in classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php and 1 other location - About 7 hrs to fix
            classes/Gems/Tracker/Source/LimeSurvey4m00FieldMap.php on lines 350..380

            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 242.

            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

            Gems_Agenda has 55 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Gems_Agenda extends \Gems_Loader_TargetLoaderAbstract
            {
                /**
                 *
                 * @var \Gems_Agenda_Appointment[]
            Severity: Major
            Found in classes/Gems/Agenda.php - About 7 hrs to fix
              Severity
              Category
              Status
              Source
              Language