mambax7/publisher

View on GitHub

Showing 3,032 of 3,032 total issues

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

    protected function serveWebshot()
    {
        $this->debug(3, 'Starting serveWebshot');
        $instr = 'Please follow the instructions at https://code.google.com/p/timthumb/ to set your server up for taking website screenshots.';
        if (!is_file(WEBSHOT_CUTYCAPT)) {
Severity: Minor
Found in thumb.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 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 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 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 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

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 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 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

Blank line found at end of control structure
Open


Severity: Minor
Found in class/Common/Metatags.php by phpcodesniffer

Blank line found at end of control structure
Open


Severity: Minor
Found in class/Common/Metatags.php by phpcodesniffer

Blank line found at end of control structure
Open


Severity: Minor
Found in class/Common/Metatags.php by phpcodesniffer

Scope keyword "protected" must be followed by a single space
Open

    protected        $lastURLError             = false;
Severity: Minor
Found in thumb.php by phpcodesniffer

There must be one USE keyword per declaration
Open

use XoopsModules\Publisher\{
Severity: Minor
Found in admin/import/ams.php by phpcodesniffer

Scope keyword "protected" must be followed by a single space
Open

    protected        $isURL                    = false;
Severity: Minor
Found in thumb.php by phpcodesniffer

Scope keyword "protected" must be followed by a single space
Open

    protected        $fileCacheVersion         = 1; //Generally if timthumb.php is modifed (upgraded) then the salt changes and all cache files are recreated. This is a backup mechanism to force regen.
Severity: Minor
Found in thumb.php by phpcodesniffer

Scope keyword "protected" must be followed by a single space
Open

    protected        $startTime                = 0.0;
Severity: Minor
Found in thumb.php by phpcodesniffer
Severity
Category
Status
Source
Language