mambax7/publisher

View on GitHub

Showing 355 of 3,032 total issues

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

function loadSampleData(): void
{
    global $xoopsConfig;
    $moduleDirName      = \basename(\dirname(__DIR__));
    $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
Severity: Minor
Found in testdata/index.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 myXMLHttpRequest has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function myXMLHttpRequest() {
    var xmlhttplocal;
    try {
        xmlhttplocal = new ActiveXObject("Msxml2.XMLHTTP")
    } catch (e) {
Severity: Minor
Found in assets/js/rating.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 createCategorySelect has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function createCategorySelect($selectedId = 0, $parentcategory = 0, $allCatOption = true, $selectname = 'options[1]', $multiple = true)
    {
        $helper = Helper::getInstance();

        $selectedId  = \explode(',', $selectedId);
Severity: Minor
Found in class/Utility.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 displayCategory has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function displayCategory(Category $categoryObj, $level = 0): void
    {
        $helper       = Helper::getInstance();
        $configurator = new Common\Configurator();
        $icons        = $configurator->icons;
Severity: Minor
Found in class/Utility.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 getEditor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getEditor(?\Xmf\Module\Helper $helper = null, ?array $options = null): ?\XoopsFormTextArea
    {
        $descEditor = null;

        /** @var Helper $helper */
Severity: Minor
Found in class/Common/SysUtility.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 setElementValues has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function setElementValues($values): void
    {
        if (\is_array($values) && !empty($values)) {
            // will not use getElementByName() for performance..
            $elements = &$this->getElements(true);
Severity: Minor
Found in class/Form/ThemeTabForm.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 __construct has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($caption, $name, $size = 15, $value = 0, $showtime = true, $formatTimestamp = true)
    {
        parent::__construct($caption, ' ');
        $value = (int)$value;
        $value = ($value > 0) ? $value : \time();
Severity: Minor
Found in class/FormDateTime.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 addCategoryOption has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function addCategoryOption(Category $categoryObj, $selectedId = 0, $level = 0, $ret = '')
    {
        $helper = Helper::getInstance();

        $spaces = '';
Severity: Minor
Found in class/Utility.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 getSummary has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSummary($maxLength = 0, $format = 'S', $stripTags = '')
    {
        $ret = $this->getVar('summary', $format);
        if (!empty($stripTags)) {
            $ret = \strip_tags($ret, $stripTags);
Severity: Minor
Found in class/Item.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 insert has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function insert(\XoopsObject $category, $force = false) //insert(&$category, $force = false)
    {
        // Auto create meta tags if empty
        /** @var Category $category */
        if (!$category->meta_keywords || !$category->meta_description) {
Severity: Minor
Found in class/CategoryHandler.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 getSubCats has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSubCats($categories)
    {
        $criteria = new \CriteriaCompo(new \Criteria('parentid', '(' . \implode(',', \array_keys($categories)) . ')', 'IN'));
        $ret      = [];
        if (!$this->publisherIsAdmin) {
Severity: Minor
Found in class/CategoryHandler.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 getEditors has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getEditors($allowedEditors = null)
    {
        $ret    = [];
        $nohtml = false;
        \xoops_load('XoopsEditorHandler');
Severity: Minor
Found in class/Utility.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 getCategories has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function &getCategories($limit = 0, $start = 0, $parentid = 0, $sort = 'weight', $order = 'ASC', $idAsKey = true)
    {
        $ret      = [];
        $criteria = new \CriteriaCompo();
        $criteria->setSort($sort);
Severity: Minor
Found in class/CategoryHandler.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 method.
Open

            return $ff;
Severity: Major
Found in thumb.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return true;
    Severity: Major
    Found in thumb.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return $this->serveCacheFile();
      Severity: Major
      Found in thumb.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return false;
        Severity: Major
        Found in thumb.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return true;
          Severity: Major
          Found in thumb.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return true;
            Severity: Major
            Found in thumb.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return false;
              Severity: Major
              Found in thumb.php - About 30 mins to fix
                Severity
                Category
                Status
                Source
                Language