Showing 4,260 of 4,272 total issues
Function loadFormData
has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring. Open
protected function loadFormData()
{
parent::loadFormData();
if ($this->createData && ($this->request->isPost() && (! isset($this->formData[$this->saveButtonId])))) {
- Read upRead up
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 RespondentModel.php
has 723 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use Gems\Exception\RespondentAlreadyExists;
/**
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function matchActivity($name, $organizationId, $create = true)
{
$cacheId = __CLASS__ . '_' . __FUNCTION__;
$matches = $this->cache->load($cacheId);
- Read upRead up
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 346.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function matchProcedure($name, $organizationId, $create = true)
{
$cacheId = __CLASS__ . '_' . __FUNCTION__;
$matches = $this->cache->load($cacheId);
- Read upRead up
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 346.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File LimeSurvey1m9FieldMap.php
has 702 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
*
* @package Gems
Gems_Project_ProjectSettings
has 79 functions (exceeds 20 allowed). Consider refactoring. Open
class Gems_Project_ProjectSettings extends \ArrayObject
{
/**
* The db adapter for the responses
*
GemsEscort
has 77 functions (exceeds 20 allowed). Consider refactoring. Open
class GemsEscort extends \MUtil_Application_Escort
{
/**
* Default reception code value
*/
Function processForm
has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring. Open
protected function processForm($saveLabel = null, $data = null)
{
$model = $this->getModel();
$mname = $model->getName();
$request = $this->getRequest();
- Read upRead up
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 MenuAbstract.php
has 628 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
*
* @package Gems
File SubMenuItem.php
has 625 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
*
* @package Gems
File Form.php
has 623 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Helper for OpenRosa forms
*
* It supports a subset of OpenRosa forms and provides a bridge between GemsTracker
File UpgradeCompatibilitySnippet.php
has 601 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
*
* @package Gems
Function addRowWithCount
has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring. Open
public function addRowWithCount($row, $writer, $rowNumber)
{
$exportRow = $this->filterRow($row);
$labeledCols = $this->getLabeledColumns();
$exportRow = array_replace(array_flip($labeledCols), $exportRow);
- Read upRead up
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
public function getSqlWhereBoth($toApps)
{
$appWheres = array();
$epiWheres = array();
- Read upRead up
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 292.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function getSqlWhereBoth($toApps)
{
$appWheres = array();
$epiWheres = array();
- Read upRead up
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 292.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function render
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
public function render($content)
{
$useBootstrap = \MUtil_Bootstrap::enabled();
if ((null === ($element = $this->getElement())) ||
- Read upRead up
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 TrackEngineAbstract.php
has 590 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
*
* @package Gems
Method addRespondentPage
has 248 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addRespondentPage($label)
{
$orgId = $this->currentUser->getCurrentOrganizationId();
$params = array(\MUtil_Model::REQUEST_ID1 => 'gr2o_patient_nr', \MUtil_Model::REQUEST_ID2 => 'gr2o_id_organization');
File StepEngineAbstract.php
has 573 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
*
* @package Gems
File BrowseEditAction.php
has 564 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
*
* @package Gems