mambax7/xnewsletter

View on GitHub

Showing 379 of 379 total issues

Similar blocks of code found in 16 locations. Consider refactoring.
Open

<?php
/**
 * Vietnamese (Tiếng Việt) PHPMailer language file: refer to English translation for definitive list.
 * @package PHPMailer
 * @author  VINADES.,JSC <contact@vinades.vn>
Severity: Major
Found in include/phpmailer/language/phpmailer.lang-vi.php and 15 other locations - About 5 hrs to fix
include/phpmailer/language/phpmailer.lang-az.php on lines 1..25
include/phpmailer/language/phpmailer.lang-be.php on lines 1..25
include/phpmailer/language/phpmailer.lang-ca.php on lines 1..25
include/phpmailer/language/phpmailer.lang-el.php on lines 1..24
include/phpmailer/language/phpmailer.lang-eo.php on lines 1..24
include/phpmailer/language/phpmailer.lang-fa.php on lines 1..26
include/phpmailer/language/phpmailer.lang-gl.php on lines 1..25
include/phpmailer/language/phpmailer.lang-he.php on lines 1..25
include/phpmailer/language/phpmailer.lang-hu.php on lines 1..25
include/phpmailer/language/phpmailer.lang-it.php on lines 1..26
include/phpmailer/language/phpmailer.lang-lt.php on lines 1..25
include/phpmailer/language/phpmailer.lang-lv.php on lines 1..25
include/phpmailer/language/phpmailer.lang-nl.php on lines 1..25
include/phpmailer/language/phpmailer.lang-sk.php on lines 1..25
include/phpmailer/language/phpmailer.lang-uk.php on lines 1..26

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 200.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 16 locations. Consider refactoring.
Open

<?php
/**
 * Dutch PHPMailer language file: refer to class.phpmailer.php for definitive list.
 * @package PHPMailer
 * @author  Tuxion <team@tuxion.nl>
Severity: Major
Found in include/phpmailer/language/phpmailer.lang-nl.php and 15 other locations - About 5 hrs to fix
include/phpmailer/language/phpmailer.lang-az.php on lines 1..25
include/phpmailer/language/phpmailer.lang-be.php on lines 1..25
include/phpmailer/language/phpmailer.lang-ca.php on lines 1..25
include/phpmailer/language/phpmailer.lang-el.php on lines 1..24
include/phpmailer/language/phpmailer.lang-eo.php on lines 1..24
include/phpmailer/language/phpmailer.lang-fa.php on lines 1..26
include/phpmailer/language/phpmailer.lang-gl.php on lines 1..25
include/phpmailer/language/phpmailer.lang-he.php on lines 1..25
include/phpmailer/language/phpmailer.lang-hu.php on lines 1..25
include/phpmailer/language/phpmailer.lang-it.php on lines 1..26
include/phpmailer/language/phpmailer.lang-lt.php on lines 1..25
include/phpmailer/language/phpmailer.lang-lv.php on lines 1..25
include/phpmailer/language/phpmailer.lang-sk.php on lines 1..25
include/phpmailer/language/phpmailer.lang-uk.php on lines 1..26
include/phpmailer/language/phpmailer.lang-vi.php on lines 1..25

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 200.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 16 locations. Consider refactoring.
Open

<?php
/**
 * Hebrew PHPMailer language file: refer to English translation for definitive list
 * @package PHPMailer
 * @author  Ronny Sherer <ronny@hoojima.com>
Severity: Major
Found in include/phpmailer/language/phpmailer.lang-he.php and 15 other locations - About 5 hrs to fix
include/phpmailer/language/phpmailer.lang-az.php on lines 1..25
include/phpmailer/language/phpmailer.lang-be.php on lines 1..25
include/phpmailer/language/phpmailer.lang-ca.php on lines 1..25
include/phpmailer/language/phpmailer.lang-el.php on lines 1..24
include/phpmailer/language/phpmailer.lang-eo.php on lines 1..24
include/phpmailer/language/phpmailer.lang-fa.php on lines 1..26
include/phpmailer/language/phpmailer.lang-gl.php on lines 1..25
include/phpmailer/language/phpmailer.lang-hu.php on lines 1..25
include/phpmailer/language/phpmailer.lang-it.php on lines 1..26
include/phpmailer/language/phpmailer.lang-lt.php on lines 1..25
include/phpmailer/language/phpmailer.lang-lv.php on lines 1..25
include/phpmailer/language/phpmailer.lang-nl.php on lines 1..25
include/phpmailer/language/phpmailer.lang-sk.php on lines 1..25
include/phpmailer/language/phpmailer.lang-uk.php on lines 1..26
include/phpmailer/language/phpmailer.lang-vi.php on lines 1..25

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 200.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File task.inc.php has 408 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * ****************************************************************************
 *  - A Project by Developers TEAM For Xoops - ( https://xoops.org )
 * ****************************************************************************
Severity: Minor
Found in include/task.inc.php - About 5 hrs to fix

    Function tln_fixstyle has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
    Open

    function tln_fixstyle($body, $pos, $trans_image_path, $block_external_images)
    {
        // workaround for </style> in between comments
        $content = '';
        $sToken  = '';
    Severity: Minor
    Found in include/phpmailer/extras/htmlfilter.php - About 5 hrs 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

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

        if (is_object($templateObj)) {
            if ( (int)$templateObj->getVar('template_type') === _XNEWSLETTER_MAILINGLIST_TPL_CUSTOM_VAL) {
                // get template from database
                $htmlBody = $xoopsTpl->fetchFromData($templateObj->getVar('template_content', 'n'));
            } else {
    Severity: Major
    Found in print.php and 3 other locations - About 5 hrs to fix
    admin/letter.php on lines 86..107
    letter.php on lines 161..182
    letter.php on lines 221..242

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 195.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

            if (is_object($templateObj)) {
                if ( (int)$templateObj->getVar('template_type') === _XNEWSLETTER_MAILINGLIST_TPL_CUSTOM_VAL) {
                    // get template from database
                    $htmlBody = $xoopsTpl->fetchFromData($templateObj->getVar('template_content', 'n'));
                } else {
    Severity: Major
    Found in letter.php and 3 other locations - About 5 hrs to fix
    admin/letter.php on lines 86..107
    letter.php on lines 221..242
    print.php on lines 75..96

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 195.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

            if (is_object($templateObj)) {
                if ( (int)$templateObj->getVar('template_type') === _XNEWSLETTER_MAILINGLIST_TPL_CUSTOM_VAL) {
                    // get template from database
                    $htmlBody = $letterTpl->fetchFromData($templateObj->getVar('template_content', 'n'));
                } else {
    Severity: Major
    Found in admin/letter.php and 3 other locations - About 5 hrs to fix
    letter.php on lines 161..182
    letter.php on lines 221..242
    print.php on lines 75..96

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 195.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

            if (is_object($templateObj)) {
                if ( (int)$templateObj->getVar('template_type') === _XNEWSLETTER_MAILINGLIST_TPL_CUSTOM_VAL) {
                    // get template from database
                    $htmlBody = $xoopsTpl->fetchFromData($templateObj->getVar('template_content', 'n'));
                } else {
    Severity: Major
    Found in letter.php and 3 other locations - About 5 hrs to fix
    admin/letter.php on lines 86..107
    letter.php on lines 161..182
    print.php on lines 75..96

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 195.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Method tln_getnxtag has 136 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function tln_getnxtag($body, $offset)
    {
        if ($offset > mb_strlen($body)) {
            return false;
        }
    Severity: Major
    Found in include/phpmailer/extras/htmlfilter.php - About 5 hrs to fix

      Method xnewsletter_emailSize has 136 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function xnewsletter_emailSize($letter_id = 0)
      {
      //    require_once XNEWSLETTER_ROOT_PATH . '/class/class.xnewslettermailer.php';
          global $XoopsTpl;
          $helper = Xnewsletter\Helper::getInstance();
      Severity: Major
      Found in include/functions.php - About 5 hrs to fix

        Method xnewsletter_printPage has 133 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function xnewsletter_printPage($content)
        {
            global $xoopsConfig, $xoops_meta_keywords, $xoops_meta_description;
            $myts = \MyTextSanitizer::getInstance(); ?>
            <!DOCTYPE html>
        Severity: Major
        Found in print.php - About 5 hrs to fix

          Function msgHTML has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
          Open

              public function msgHTML($message, $basedir = '', $advanced = false)
              {
                  preg_match_all('/(src|background)=["\'](.*)["\']/Ui', $message, $images);
                  if (array_key_exists(2, $images)) {
                      if (mb_strlen($basedir) > 1 && '/' != mb_substr($basedir, -1)) {
          Severity: Minor
          Found in include/phpmailer/class.phpmailer.php - About 5 hrs 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

          Method subscribingMLHandler has 131 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function subscribingMLHandler($type, $subscr_id, $mailinglist_id)
          {
              global $xoopsUser, $xoopsConfig;
              $helper = XoopsModules\Xnewsletter\Helper::getInstance();
          
          
          Severity: Major
          Found in include/mailinglist.php - About 5 hrs to fix

            Function authenticate has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

                public function authenticate(
                    $username,
                    $password,
                    $authtype = null,
                    $realm = '',
            Severity: Minor
            Found in include/phpmailer/class.smtp.php - About 5 hrs 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

            SMTP has 38 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class SMTP
            {
                /**
                 * The PHPMailer SMTP version number.
                 * @var string
            Severity: Minor
            Found in include/phpmailer/class.smtp.php - About 5 hrs to fix

              File class.phpmailer-bmh.php has 374 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /* class.phpmailer-bmh.php
              .---------------------------------------------------------------------------.
              |  Software: PHPMailer-BMH (Bounce Mail Handler)                            |
              |   Version: 5.0.0rc1                                                       |
              Severity: Minor
              Found in include/phpmailer_bmh/class.phpmailer-bmh.php - About 5 hrs to fix

                File import.php has 373 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * ****************************************************************************
                 *  - A Project by Developers TEAM For Xoops - ( https://xoops.org )
                 * ****************************************************************************
                Severity: Minor
                Found in admin/import.php - About 4 hrs to fix

                  Function subscribingMLHandler has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function subscribingMLHandler($type, $subscr_id, $mailinglist_id)
                  {
                      global $xoopsUser, $xoopsConfig;
                      $helper = XoopsModules\Xnewsletter\Helper::getInstance();
                  
                  
                  Severity: Minor
                  Found in include/mailinglist.php - About 4 hrs 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 xnewsletter_plugin_getdata_csv has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function xnewsletter_plugin_getdata_csv(
                      $cat_id,
                      $action_after_read,
                      $limitCheck,
                      $skipCatsubscrExist,
                  Severity: Minor
                  Found in plugins/csv.php - About 4 hrs 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