spotweb/spotweb

View on GitHub

Showing 850 of 850 total issues

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

    public function sendNzbHandled($action, $spot)
    {
        switch ($action) {
            case 'save': $notification = $this->_notificationTemplate->template('nzb_save', ['spot' => $spot, 'nzbhandling' => $this->_currentSession['user']['prefs']['nzbhandling']]);
                break;
Severity: Minor
Found in lib/SpotNotifications.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 retrieveInfo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function retrieveInfo()
    {
        $mediaInfo = new Dto_MediaInformation();
        $mediaInfo->setValid(false);

Severity: Minor
Found in lib/services/MediaInformation/Services_MediaInformation_Tvmaze.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 arrayKeyToInForComments has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function arrayKeyToInForComments($ar)
    {
        $tmpList = '';

        if (!is_array($ar) || count($ar) == 0) {
Severity: Minor
Found in lib/dbeng/dbeng_abs.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 send has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        private function send($data)
        {
            if ((!defined('GROWL_SOCK') && function_exists('socket_create') && function_exists('socket_sendto')) || (GROWL_SOCK === 'socket')) {
                $sck = (strlen(inet_pton($this->address)) > 4 && defined('AF_INET6'))
                    ? socket_create(AF_INET6, SOCK_DGRAM, SOL_UDP)
Severity: Minor
Found in lib/notifications/growl/class.growl.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 postComment has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function postComment($user, $serverPrivKey, $newsgroup, $comment)
    {
        /*
         * Create the comment specific headers
         */
Severity: Minor
Found in lib/services/Nntp/Services_Nntp_SpotPosting.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 build has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function build($appName, $provider, array $dataArray)
    {
        // Nieuwe handlers voegen we expliciet toe omdat we anders
        // niet weten wat we includen in combinate met __autoload()
        switch ($provider) {
Severity: Minor
Found in lib/notifications/Notifications_Factory.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 addPermToSecGroup has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function addPermToSecGroup($groupId, $perm)
    {
        $result = new Dto_FormResult();
        $result = $this->allowedToEditGroup($result, $groupId);

Severity: Minor
Found in lib/services/User/Services_User_Record.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 getCache has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getCache($resourceid, $cachetype)
    {
        $tmp = $this->_conn->arrayQuery(
            'SELECT id, stamp, ttl, metadata FROM cache WHERE resourceid = :resourceid AND cachetype = :cachetype',
            [
Severity: Minor
Found in lib/dao/Base/Dao_Base_Cache.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 getMaxMessageId has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMaxMessageId($headers)
    {
        SpotTiming::start(__CLASS__.'::'.__FUNCTION__);

        if ($headers == 'headers') {
Severity: Minor
Found in lib/dao/Base/Dao_Base_Spot.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 deleteFilter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function deleteFilter($userId, $filterId, $filterType)
    {
        $filterList = $this->getFilterList($userId, $filterType);
        foreach ($filterList as $filter) {
            if ($filter['id'] == $filterId) {
Severity: Minor
Found in lib/dao/Base/Dao_Base_UserFilter.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