GemsTracker/gemstracker-library

View on GitHub

Showing 1,617 of 4,272 total issues

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

    public function getHtmlOutput(\Zend_View_Abstract $view) {
        //$view->headLink()->prependStylesheet($view->serverUrl() . \GemsEscort::getInstance()->basepath->getBasePath() . '/gems/css/barchart.less', 'screen,print');

        $htmlDiv   = \MUtil_Html::create()->div(' ', array('class'=>'barchartcontainer'));
Severity: Minor
Found in classes/Gems/Snippets/Survey/Display/BarChartSnippet.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 getActionLinks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getActionLinks(\MUtil_Model_Bridge_TableBridge $bridge)
    {
        // Get the other token buttons
        if ($menuItems = $this->menu->findAll(array('controller' => 'track', 'action' => array('email', 'answer'), 'allowed' => true))) {
            $buttons = $menuItems->toActionLink($this->request, $bridge);
Severity: Minor
Found in classes/Gems/Snippets/TokenPlanTableSnippet.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 processSelectorFilterName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function processSelectorFilterName($name, \Zend_Controller_Request_Abstract $request, array $filter, array $defaults = null)
    {
        if (isset($filter[$name])) {
            return $filter[$name];
        }
Severity: Minor
Found in classes/Gems/Selector/DateSelectorAbstract.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 loadData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function loadData($id)
    {
        if (\Gems_User_UserLoader::SYSTEM_NO_ORG === $id) {
            $data = false;
        } else {
Severity: Minor
Found in classes/Gems/User/Organization.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 notAlphaCount has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function notAlphaCount($parameter, $password)
    {
        $len = intval($parameter);
        if ($len) {
            $results = array(); // Not used but required
Severity: Minor
Found in classes/Gems/User/PasswordChecker.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 ensureDefaultUserValues has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function ensureDefaultUserValues(array $values, \Gems_User_UserDefinitionInterface $definition, $defName = null)
    {
        if (! isset($values['user_active'])) {
            $values['user_active'] = true;
        }
Severity: Minor
Found in classes/Gems/User/UserLoader.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 getTwoFactorAuthenticator has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getTwoFactorAuthenticator()
    {
        if (! $this->_authenticator instanceof TwoFactorAuthenticatorInterface) {
            if ($this->_hasVar('user_two_factor_key')) {
                $authClass = \MUtil_String::beforeChars(
Severity: Minor
Found in classes/Gems/User/User.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 sendCommunication has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function sendCommunication(array $job, array $tokenData, $preview)
    {
        $token = $this->loader->getTracker()->getToken($tokenData);
        $clientId = 'sms';
        if (isset($job['gcm_messenger_identifier'])) {
Severity: Minor
Found in classes/Gems/Communication/JobMessenger/SmsJobMessenger.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 numCount has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function numCount($parameter, $password)
    {
        $len = intval($parameter);
        if ($len) {
            $results = array(); // Not used but required
Severity: Minor
Found in classes/Gems/User/PasswordChecker.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 getSecretKey has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSecretKey()
    {
        if ($this->isEmbedded()) {
            if (! $this->_hasVar('secretKey')) {
                if (! $this->_hasVar('gsus_secret_key')) {
Severity: Minor
Found in classes/Gems/User/User.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 setGroupTemp has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function setGroupTemp($groupId)
    {
        $this->_group = null;

        if ($groupId == $this->_getVar('user_group')) {
Severity: Minor
Found in classes/Gems/User/User.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 sendMail has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function sendMail($subjectTemplate, $bbBodyTemplate, $useResetFields = false, $locale = null)
    {
        if ($useResetFields && (! $this->canResetPassword())) {
            return $this->_('Trying to send a password reset to a user that cannot be reset.');
        }
Severity: Minor
Found in classes/Gems/User/User.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 notAlphaNumCount has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function notAlphaNumCount($parameter, $password)
    {
        $len = intval($parameter);
        if ($len) {
            $results = array(); // Not used but required
Severity: Minor
Found in classes/Gems/User/PasswordChecker.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 getMonitorFrom has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMonitorFrom($name = null)
    {
        if ($name) {
            if (isset($this['monitor'], $this['monitor'][$name], $this['monitor'][$name]['from']) &&
                    trim($this['monitor'][$name]['from'])) {
Severity: Minor
Found in classes/Gems/Project/ProjectSettings.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 getTwoFactorMethods has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getTwoFactorMethods()
    {
        if (isset($this['twoFactor'], $this['twoFactor']['methods'])) {
            $methods = [];
            foreach($this['twoFactor']['methods'] as $authenticator=>$authSettings) {
Severity: Minor
Found in classes/Gems/Project/ProjectSettings.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 getUserData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getUserData($login_name, $organization)
    {
        $orgs = null;

        try {
Severity: Minor
Found in classes/Gems/User/ConsoleUserDefinition.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 _getVar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _getVar($name)
    {
        $store = $this->_getVariableStore();

        if ($store instanceof \Zend_Session_Namespace) {
Severity: Minor
Found in classes/Gems/User/User.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