mambax7/extgallery

View on GitHub

Showing 701 of 9,653 total issues

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

    public function custom_media_uploader_tabs($strings)
    {
        //update strings
        if (\Xmf\Request::hasVar('page', 'GET') && 'metaslider' == $_GET['page']) {
            $strings['insertMediaTitle'] = __('Image', 'metaslider');
Severity: Minor
Found in assets/js/ml-slider/ml-slider.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 xoops_module_uninstall_extgallery has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function xoops_module_uninstall_extgallery(\XoopsModule $module)
{
    //    return true;

    $moduleDirName      = \basename(\dirname(__DIR__));
Severity: Minor
Found in include/onuninstall.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 display has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function display($type = '', $quality = 75)
    {
        if ('' == $type) {
            header('Content-type: image/' . $this->type);
            if (!imagick_dump($this->imageHandle)) {
Severity: Minor
Found in class/pear/Image/Transform/Driver/Imagick.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 addText has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function addText($params)
    {
        $this->oldImage = $this->imageHandle;
        $params         = array_merge($this->_get_default_text_params(), $params);

Severity: Minor
Found in class/pear/Image/Transform/Driver/Imagick2.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 is__writable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function is__writable($path)
{
    //will work in despite of Windows ACLs bug
    //NOTE: use a trailing slash for folders!!!
    //see http://bugs.php.net/bug.php?id=27609
Severity: Minor
Found in admin/main.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 addText has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function addText($params)
    {
        $this->oldImage = clone $this->imagick;
        $params         = array_merge($this->_get_default_text_params(), $params);

Severity: Minor
Found in class/pear/Image/Transform/Driver/Imagick3.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 getImageTest has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function getImageTest()
{
    $ret = [];
    $rep = \dirname(__DIR__) . '/assets/images/';
    $dir = opendir($rep);
Severity: Minor
Found in admin/watermark-border.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 loadSampleData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

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

function extgalleryListEdit($options)
{
    $catHandler = Extgallery\Helper::getInstance()->getHandler('PublicCategory');
    $form       = _MB_EXTGALLERY_PHOTO_NUMBER . ' : <input name="options[]" size="5" maxlength="255" value="' . $options[0] . '" type="text"><br>';
    //==================================
Severity: Minor
Found in blocks/extgallery_blocks.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 staticPushErrorHandling has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function staticPushErrorHandling($mode, $options = null)
    {
        $stack       = &$GLOBALS['_PEAR_error_handler_stack'];
        $def_mode    = &$GLOBALS['_PEAR_default_error_mode'];
        $def_options = &$GLOBALS['_PEAR_default_error_options'];
Severity: Minor
Found in class/pear/PEAR.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 readPHPArgv has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function readPHPArgv()
    {
        global $argv;
        if (!is_array($argv)) {
            if (!@is_array($_SERVER['argv'])) {
Severity: Minor
Found in class/pear/Console/Getopt.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 resize_image has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function resize_image($orig_size, $dest_size, $dest_file_name)
    {
        // load image
        $image = wp_get_image_editor($this->path);

Severity: Minor
Found in assets/js/ml-slider/inc/metaslider.imagehelper.class.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 PclTarAdd has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function PclTarAdd($p_tarname, $p_filelist)
    {
        TrFctStart(__FILE__, __LINE__, 'PclTarAdd', "tar=$p_tarname, file=$p_filelist");
        $v_result      = 1;
        $v_list_detail = [];
Severity: Minor
Found in class/pcltar.lib.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 get_setting has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_setting($name)
    {
        if (!isset($this->settings[$name])) {
            $defaults = $this->get_default_parameters();

Severity: Minor
Found in assets/js/ml-slider/inc/slider/metaslider.class.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 rotate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function rotate($angle)
    {
        $this->oldHandle   = $this->imageHandle;
        $this->imageHandle = imlib_create_rotated_image($this->imageHandle, $angle);
        $new_x             = imlib_image_get_width($this->imageHandle);
Severity: Minor
Found in class/pear/Image/Transform/Driver/Imlib.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 display has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function display($type = '', $quality = null)
    {
        $options = is_array($quality) ? $quality : [];
        if (is_numeric($quality)) {
            $options['quality'] = $quality;
Severity: Minor
Found in class/pear/Image/Transform/Driver/Imagick3.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 convertIPAddresses has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function convertIPAddresses($tableName, $columnName)
    {
        if ($this->tableHandler->useTable($tableName)) {
            $attributes = $this->tableHandler->getColumnAttributes($tableName, $columnName);
            if (false !== mb_strpos($attributes, ' int(')) {
Severity: Minor
Found in class/Common/Migrate.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 staticPopErrorHandling has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function staticPopErrorHandling()
    {
        $stack      = &$GLOBALS['_PEAR_error_handler_stack'];
        $setmode    = &$GLOBALS['_PEAR_default_error_mode'];
        $setoptions = &$GLOBALS['_PEAR_default_error_options'];
Severity: Minor
Found in class/pear/PEAR.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 GenerateCode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function GenerateCode()
    {
        // reset code
        $this->sCode = '';

Severity: Minor
Found in class/PhpCaptcha.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 numDescendants has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function numDescendants($id)
    {
        if (0 == $id) {
            $query  = \sprintf('SELECT COUNT(*) AS num_descendants FROM `%s`', $this->table);
            $result = $this->db->query($query);
Severity: Minor
Found in class/NestedTree.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