GemsTracker/gemstracker-library

View on GitHub

Showing 1,617 of 4,272 total issues

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

    protected function createModel($detailed, $action)
    {
        $model = $this->loader->getModels()->getSurveyMaintenanceModel();

        if ($detailed) {
Severity: Minor
Found in classes/Gems/Default/SurveyMaintenanceAction.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

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

    protected function createModel($detailed, $action)
    {
        $respondent = $this->getRespondent();

        $model = $this->loader->getModels()->createEpisodeOfCareModel();
Severity: Minor
Found in classes/Gems/Default/CareEpisodeAction.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

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

    protected function createModel($detailed, $action)
    {
        $model = $this->loader->getModels()->getConditionModel();

        if ($detailed) {
Severity: Minor
Found in classes/Gems/Default/ConditionAction.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

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

    public function getOnEmptyText()
    {
        static $warned;

        $dir = $this->getPath(false, 'index');
Severity: Minor
Found in classes/Gems/Default/FileActionAbstract.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

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

    public function preDispatch()
    {
        parent::preDispatch();

        $action = strtolower($this->getRequest()->getActionName());
Severity: Minor
Found in classes/Gems/Default/OpenrosaAction.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

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

    public function getToken()
    {
        static $token;

        if ($token instanceof \Gems_Tracker_Token) {
Severity: Minor
Found in classes/Gems/Default/TrackAction.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

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

    public function getKeyRef($forData, $href = array(), $organizationInKey = null)
    {
        $keys = $this->getKeys();

        if (! $organizationInKey) {
Severity: Minor
Found in classes/Gems/Model/HiddenOrganizationModel.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

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

    protected function transformSaveSubModel(
        \MUtil_Model_ModelAbstract $model, \MUtil_Model_ModelAbstract $sub, array &$row, array $join, $name)
    {
        if (!isset($row['table_keys'])) {
            $tableKeys = $model->getKeys();
Severity: Minor
Found in classes/Gems/Model/Transform/TranslateFieldEditor.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

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

    public function applyBrowseSettings()
    {
        $dbLookup    = $this->util->getDbLookup();
        $definitions = $this->loader->getUserLoader()->getAvailableStaffDefinitions();
        $localized   = $this->util->getLocalized();
Severity: Minor
Found in classes/Gems/Model/OrganizationModel.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

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

    public function save(array $newValues, array $filter = null, array $saveTables = null)
    {
        //First perform a save
        $savedValues = parent::save($newValues, $filter, $saveTables);

Severity: Minor
Found in classes/Gems/Model/StaffModel.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

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

    public function transformFilter(\MUtil_Model_ModelAbstract $model, array $filter)
    {
        if (is_array($this->tableKeys)) {
            foreach($this->tableKeys as $tableName => $itemNames) {
                foreach($itemNames as $itemName) {
Severity: Minor
Found in classes/Gems/Model/Transform/TranslateDatabaseFields.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

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

    public function translateRowValues($row, $key)
    {
        $row = parent::translateRowValues($row, $key);

        if (! $row) {
Severity: Minor
Found in classes/Gems/Model/Translator/RespondentTranslator.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

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

    public function translateRowValues($row, $key)
    {
        $row = parent::translateRowValues($row, $key);

        if (! $row) {
Severity: Minor
Found in classes/Gems/Model/Translator/AnswerTranslatorAbstract.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

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

    public function getHtmlOutput(\Zend_View_Abstract $view)
    {
        $table = parent::getHtmlOutput($view);
        $table->getOnEmpty()->class = 'centerAlign';

Severity: Minor
Found in classes/Gems/Snippets/FolderModelTableSnippet.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

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

    protected function processForm()
    {
        if ($this->request->getParam('resend') == '1') {
            $authenticator = $this->user->getTwoFactorAuthenticator();
            if ($authenticator instanceof SendTwoFactorCodeInterface) {
Severity: Minor
Found in classes/Gems/Snippets/Login/TwoFactorCheckSnippet.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

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

    public function getRelationsFor($respondentId, $patientNr = null, $organizationId = null, $onlyActive = true)
    {
        static $relationsCache = array();

        if (is_null($respondentId)) {
Severity: Minor
Found in classes/Gems/Model/RespondentRelationModel.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

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

    protected function addBrowseTableColumns(\MUtil_Model_Bridge_TableBridge $bridge, \MUtil_Model_ModelAbstract $model)
    {
        // Make sure these fields are loaded
        $model->get('gro_valid_after_field');
        $model->get('gro_valid_after_id');
Severity: Minor
Found in classes/Gems/Snippets/Tracker/Rounds/RoundsTableSnippet.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

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

    protected function addTableCells(\MUtil_Model_Bridge_VerticalTableBridge $bridge)
    {
        $HTML = \MUtil_Html::create();

        // $bridge->caption($this->getCaption());
Severity: Minor
Found in classes/Gems/Snippets/Respondent/RespondentMinimalDetailsSnippet.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

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

    protected function loadFormData()
    {
        parent::loadFormData();

        if ($this->trackEngine instanceof \Gems_Tracker_Engine_StepEngineAbstract) {
Severity: Minor
Found in classes/Gems/Snippets/Tracker/Rounds/EditRoundStepSnippet.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

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

    protected function afterSave($changed)
    {
        // Communicate to user
        if ($changed >= 0) {
            switch ($this->formData['change_method']) {
Severity: Minor
Found in classes/Gems/Snippets/Respondent/ChangeRespondentOrganization.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

Severity
Category
Status
Source
Language