mambax7/wflinks

View on GitHub
class/VCard.php

Summary

Maintainability
B
6 hrs
Test Coverage

Function vcard_quoted_printable_encode has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

function vcard_quoted_printable_encode($input, $line_max = 76)
{
    $hex       = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'];
    $lines     = \preg_split("/(?:\r\n|\r|\n)/", $input);
    $eol       = "\r\n";
Severity: Minor
Found in class/VCard.php - About 1 hr 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 vcard_quoted_printable_encode has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function vcard_quoted_printable_encode($input, $line_max = 76)
{
    $hex       = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'];
    $lines     = \preg_split("/(?:\r\n|\r|\n)/", $input);
    $eol       = "\r\n";
Severity: Minor
Found in class/VCard.php - About 1 hr to fix

    Method setAddress has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $postoffice = '',
            $extended = '',
            $street = '',
            $city = '',
            $region = '',
    Severity: Major
    Found in class/VCard.php - About 1 hr to fix

      Method setLabel has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $postoffice = '',
              $extended = '',
              $street = '',
              $city = '',
              $region = '',
      Severity: Major
      Found in class/VCard.php - About 1 hr to fix

        Method setName has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function setName($family = '', $first = '', $additional = '', $prefix = '', $suffix = '')
        Severity: Minor
        Found in class/VCard.php - About 35 mins to fix

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

              public function setLabel(
                  $postoffice = '',
                  $extended = '',
                  $street = '',
                  $city = '',
          Severity: Minor
          Found in class/VCard.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

          There are no issues that match your filters.

          Category
          Status