spotweb/spotweb

View on GitHub

Showing 668 of 850 total issues

Function render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function render()
    {
        // Make sure the result is set to 'not comitted' per default
        $result = new Dto_FormResult('notsubmitted');

Severity: Minor
Found in lib/page/SpotPage_postcomment.php - About 35 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 displayLine has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static function displayLine($values)
    {
        if (isset($values['start'])) {
            if (self::$_useHtml) {
                try {
Severity: Minor
Found in lib/SpotTiming.php - About 35 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 swDtToNative has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function swDtToNative($colType)
    {
        switch (strtoupper($colType)) {
            case 'INTEGER': $colType = 'integer';
                break;
Severity: Minor
Found in lib/dbstruct/SpotStruct_pgsql.php - About 35 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 swDtToNative has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function swDtToNative($colType)
    {
        switch (strtoupper($colType)) {
            case 'INTEGER': $colType = 'int';
                break;
Severity: Minor
Found in lib/dbstruct/SpotStruct_mysql.php - About 35 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 initializeCategoryTree has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function initializeCategoryTree() {
        // Attach the dynatree widget to an existing <div id="tree"> element
        // and pass the tree options as an argument to the dynatree() function:
        $("div#tree").hide();
        $("div#tree").dynatree({
Severity: Minor
Found in templates/we1rdo/js/treehelper.js - About 35 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 render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function render()
    {
        $result = new Dto_FormResult('notsubmitted');

        // check the users' permissions
Severity: Minor
Found in lib/page/SpotPage_editspot.php - About 35 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 swDtToNative has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function swDtToNative($colType)
    {
        switch (strtoupper($colType)) {
            case 'INTEGER': $colType = 'INTEGER';
                break;
Severity: Minor
Found in lib/dbstruct/SpotStruct_sqlite.php - About 35 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 filterToQuery has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function filterToQuery($search, $sort, $currentSession, $indexFilter)
    {
        SpotTiming::start(__CLASS__.'::'.__FUNCTION__);

        $isUnfiltered = false;
Severity: Minor
Found in lib/services/Search/Services_Search_QueryParser.php - About 35 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 useOrStartSession has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function useOrStartSession($forceAnonymous)
    {
        $userSession = false;

        if ((isset($_COOKIE['spotsession'])) && (!$forceAnonymous)) {
Severity: Minor
Found in lib/services/User/Services_User_Authentication.php - About 35 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 moveUp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function moveUp($id)
    {
        $output = $this->querySabnzbd('mode=queue&output=json');
        $response = json_decode($output, true);

Severity: Minor
Found in lib/services/NzbHandler/Services_NzbHandler_Pushsabnzbd.php - About 35 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 readComments has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function readComments($commentList)
    {
        $comments = [];
        $spotSigning = Services_Signing_Base::factory();

Severity: Minor
Found in lib/services/Nntp/Services_Nntp_SpotReading.php - About 35 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 getArticle has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getArticle($msgId)
    {
        SpotDebug::msg(SpotDebug::TRACE, __CLASS__.'->getArticle('.$msgId.')');
        $this->connect();

Severity: Minor
Found in lib/services/Nntp/Services_Nntp_Engine.php - About 35 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 correctElmContents has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function correctElmContents($xmlStr, $elems)
    {
        $cdataStart = '<![CDATA[';
        $cdataEnd = ']]>';

Severity: Minor
Found in lib/services/Format/Services_Format_Parsing.php - About 35 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 putCacheContent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function putCacheContent($cacheId, $cacheType, $content, $metaData)
    {
        /*
           * Get the unique filepath
           */
Severity: Minor
Found in lib/dao/Base/Dao_Base_Cache.php - About 35 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 ngettext has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function ngettext($msg, $msg_plural, $count)
    {
        if (!@$this->parsed[$this->locale][$this->domain]) {
            $this->parse($this->locale, $this->domain);
        }
Severity: Minor
Found in lib/gettext/Gettext_PHP.php - About 35 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 dngettext has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function dngettext($domain, $msg, $msg_plural, $count)
    {
        if (!@$this->parsed[$this->locale][$domain]) {
            $this->parse($this->locale, $domain);
        }
Severity: Minor
Found in lib/gettext/Gettext_PHP.php - About 35 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

Avoid too many return statements within this function.
Open

                return '[' + ret.join(',') + ']';
Severity: Major
Found in js/jquery-json/jquery.json-2.3.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                    return '"' + year + '-' + month + '-' + day + 'T' +
                        hours + ':' + minutes + ':' + seconds +
                        '.' + milli + 'Z"';
    Severity: Major
    Found in js/jquery-json/jquery.json-2.3.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return this;
      Severity: Major
      Found in js/jquery/jquery.form.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return $(el).val();
        Severity: Major
        Found in js/jquery/jquery.form.js - About 30 mins to fix
          Severity
          Category
          Status
          Source
          Language