plugins/html/classes/yf_html.class.php

Summary

Maintainability
F
2 wks
Test Coverage

File yf_html.class.php has 1654 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * HTML high-level controls collection.
 *
Severity: Major
Found in plugins/html/classes/yf_html.class.php - About 4 days to fix

    yf_html has 65 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class yf_html
    {
        public $AUTO_ASSIGN_IDS = true;
        public $BOXES_USE_STPL = false;
        public $SELECT_BOX_DEF_OPT_TPL = '- %select% %name% -';
    Severity: Major
    Found in plugins/html/classes/yf_html.class.php - About 1 day to fix

      Function multi_check_box has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
      Open

          public function multi_check_box($name, $values = [], $selected = [], $horizontal = true, $type = 2, $add_str = '', $translate = 0, $name_as_array = false)
          {
              if (is_array($name)) {
                  $extra = (array) $extra + $name;
                  $name = $extra['name'];
      Severity: Minor
      Found in plugins/html/classes/yf_html.class.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 multi_select has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

          public function multi_select($name, $values = [], $selected = '', $show_text = false, $type = 2, $add_str = '', $translate = 0, $level = 0, $disabled = false)
          {
              // Passing params as array
              if (is_array($name)) {
                  $extra = (array) $extra + $name;
      Severity: Minor
      Found in plugins/html/classes/yf_html.class.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

      Method multi_check_box has 87 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function multi_check_box($name, $values = [], $selected = [], $horizontal = true, $type = 2, $add_str = '', $translate = 0, $name_as_array = false)
          {
              if (is_array($name)) {
                  $extra = (array) $extra + $name;
                  $name = $extra['name'];
      Severity: Major
      Found in plugins/html/classes/yf_html.class.php - About 3 hrs to fix

        Function tabs has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            public function tabs($tabs = [], $extra = [])
            {
                $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
        
                $extra_by_id = [];
        Severity: Minor
        Found in plugins/html/classes/yf_html.class.php - About 3 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 dd_table has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

            public function dd_table($replace = [], $field_types = [], $extra = [])
            {
                $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
                if (DEBUG_MODE) {
                    $ts = microtime(true);
        Severity: Minor
        Found in plugins/html/classes/yf_html.class.php - About 3 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 select_box has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            public function select_box($name, $values = [], $selected = '', $show_text = false, $type = 2, $add_str = '', $translate = 0, $level = 0)
            {
                // Passing params as array
                if (is_array($name)) {
                    $extra = (array) $extra + $name;
        Severity: Minor
        Found in plugins/html/classes/yf_html.class.php - About 2 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 multi_select has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function multi_select($name, $values = [], $selected = '', $show_text = false, $type = 2, $add_str = '', $translate = 0, $level = 0, $disabled = false)
            {
                // Passing params as array
                if (is_array($name)) {
                    $extra = (array) $extra + $name;
        Severity: Major
        Found in plugins/html/classes/yf_html.class.php - About 2 hrs to fix

          Method radio_box has 69 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function radio_box($name, $values = [], $selected = '', $horizontal = true, $type = 2, $add_str = '', $translate = 0)
              {
                  if (is_array($name)) {
                      $extra = (array) $extra + $name;
                      $name = $extra['name'];
          Severity: Major
          Found in plugins/html/classes/yf_html.class.php - About 2 hrs to fix

            Function menu has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

                public function menu($data = [], $extra = [])
                {
                    $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
                    if ($data) {
                        $data = $this->_recursive_sort_items($data);
            Severity: Minor
            Found in plugins/html/classes/yf_html.class.php - About 2 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 tabs has 66 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function tabs($tabs = [], $extra = [])
                {
                    $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
            
                    $extra_by_id = [];
            Severity: Major
            Found in plugins/html/classes/yf_html.class.php - About 2 hrs to fix

              Function radio_box has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function radio_box($name, $values = [], $selected = '', $horizontal = true, $type = 2, $add_str = '', $translate = 0)
                  {
                      if (is_array($name)) {
                          $extra = (array) $extra + $name;
                          $name = $extra['name'];
              Severity: Minor
              Found in plugins/html/classes/yf_html.class.php - About 2 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 select_box has 64 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function select_box($name, $values = [], $selected = '', $show_text = false, $type = 2, $add_str = '', $translate = 0, $level = 0)
                  {
                      // Passing params as array
                      if (is_array($name)) {
                          $extra = (array) $extra + $name;
              Severity: Major
              Found in plugins/html/classes/yf_html.class.php - About 2 hrs to fix

                Method phone_box has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function phone_box($name = 'phone', $values = [], $selected = '', $extra = [])
                    {
                        if (is_array($name)) {
                            $extra = (array) $extra + $name;
                        } else {
                Severity: Major
                Found in plugins/html/classes/yf_html.class.php - About 2 hrs to fix

                  Method select2_box has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function select2_box($name, $values = [], $selected = '', $extra = [])
                      {
                          $css = [];
                          $style = [];
                          if (is_array($name)) {
                  Severity: Major
                  Found in plugins/html/classes/yf_html.class.php - About 2 hrs to fix

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

                        public function a()
                        {
                            $args = func_get_args();
                            $a = [];
                            // numerics params
                    Severity: Minor
                    Found in plugins/html/classes/yf_html.class.php - About 2 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 dd_table has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function dd_table($replace = [], $field_types = [], $extra = [])
                        {
                            $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
                            if (DEBUG_MODE) {
                                $ts = microtime(true);
                    Severity: Minor
                    Found in plugins/html/classes/yf_html.class.php - About 2 hrs to fix

                      Method a has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function a()
                          {
                              $args = func_get_args();
                              $a = [];
                              // numerics params
                      Severity: Minor
                      Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

                        Method menu has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function menu($data = [], $extra = [])
                            {
                                $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
                                if ($data) {
                                    $data = $this->_recursive_sort_items($data);
                        Severity: Minor
                        Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

                          Method button_box has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function button_box($name, $values = [], $selected = '', $extra = [])
                              {
                                  if (is_array($name)) {
                                      $extra = (array) $extra + $name;
                                      $name = $extra['name'];
                          Severity: Minor
                          Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

                            Method check_box has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function check_box($name = '', $value = '', $selected = '', $add_str = '', $extra = [])
                                {
                                    if (is_array($name)) {
                                        $extra = (array) $extra + $name;
                                        $name = $extra['name'];
                            Severity: Minor
                            Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

                              Method div_box has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function div_box($name, $values = [], $selected = '', $extra = [])
                                  {
                                      if (is_array($name)) {
                                          $extra = (array) $extra + $name;
                                          $name = $extra['name'];
                              Severity: Minor
                              Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

                                Method media_objects has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function media_objects($data = [], $extra = [])
                                    {
                                        $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
                                        if ($data) {
                                            $data = $this->_recursive_sort_items($data);
                                Severity: Minor
                                Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

                                  Method carousel has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function carousel($data = [], $extra = [])
                                      {
                                          $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
                                          $items = [];
                                          $headers = [];
                                  Severity: Minor
                                  Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

                                    Method accordion has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function accordion($data = [], $extra = [])
                                        {
                                            $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
                                            $items = [];
                                            foreach ((array) $data as $k => $v) {
                                    Severity: Minor
                                    Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

                                      Method simple_table has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function simple_table($replace = [], $extra = [])
                                          {
                                              if ( ! $replace) {
                                                  return false;
                                              }
                                      Severity: Minor
                                      Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

                                        Method multi_select_box has 9 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                            public function multi_select_box($name, $values = [], $selected = '', $show_text = false, $type = 2, $add_str = '', $translate = 0, $level = 0, $disabled = false)
                                        Severity: Major
                                        Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

                                          Method multi_select has 9 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                              public function multi_select($name, $values = [], $selected = '', $show_text = false, $type = 2, $add_str = '', $translate = 0, $level = 0, $disabled = false)
                                          Severity: Major
                                          Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

                                            Function li has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                                public function li($data = [], $extra = [])
                                                {
                                                    $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
                                                    $items = [];
                                                    foreach ((array) $data as $v) {
                                            Severity: Minor
                                            Found in plugins/html/classes/yf_html.class.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

                                            Function media_objects has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                                public function media_objects($data = [], $extra = [])
                                                {
                                                    $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
                                                    if ($data) {
                                                        $data = $this->_recursive_sort_items($data);
                                            Severity: Minor
                                            Found in plugins/html/classes/yf_html.class.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

                                            Function button_box has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                                public function button_box($name, $values = [], $selected = '', $extra = [])
                                                {
                                                    if (is_array($name)) {
                                                        $extra = (array) $extra + $name;
                                                        $name = $extra['name'];
                                            Severity: Minor
                                            Found in plugins/html/classes/yf_html.class.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 thumbnails has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                public function thumbnails($data = [], $extra = [])
                                                {
                                                    $items = [];
                                                    $columns = (int) $extra['columns'] ?: 3;
                                                    $row_class = 'span' . round(12 / $columns) . ' col-md-' . round(12 / $columns);
                                            Severity: Minor
                                            Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

                                              Method image_select_box has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                  public function image_select_box($name, $values = [], $selected = '', $extra = [])
                                                  {
                                                      if (is_array($name)) {
                                                          $extra = (array) $extra + $name;
                                                      } else {
                                              Severity: Minor
                                              Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

                                                Method navbar has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                    public function navbar($data = [], $extra = [])
                                                    {
                                                        $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
                                                        $items = [];
                                                        $brand = '';
                                                Severity: Minor
                                                Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

                                                  Method list_box has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                      public function list_box($name, $values = [], $selected = '', $extra = [])
                                                      {
                                                          if (is_array($name)) {
                                                              $extra = (array) $extra + $name;
                                                              $name = $extra['name'];
                                                  Severity: Minor
                                                  Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

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

                                                        public function multi_check_box($name, $values = [], $selected = [], $horizontal = true, $type = 2, $add_str = '', $translate = 0, $name_as_array = false)
                                                    Severity: Major
                                                    Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

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

                                                          public function select_box($name, $values = [], $selected = '', $show_text = false, $type = 2, $add_str = '', $translate = 0, $level = 0)
                                                      Severity: Major
                                                      Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

                                                        Function __clone has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                        Open

                                                            public function __clone()
                                                            {
                                                                $keep_prefix = 'CLASS_';
                                                                $keep_len = strlen($keep_prefix);
                                                                $keep_prefix2 = 'CONF_';
                                                        Severity: Minor
                                                        Found in plugins/html/classes/yf_html.class.php - About 55 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 icon has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                        Open

                                                            public function icon()
                                                            {
                                                                $args = func_get_args();
                                                                $a = [];
                                                                // numerics params
                                                        Severity: Minor
                                                        Found in plugins/html/classes/yf_html.class.php - About 55 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

                                                        Method date_box2 has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                                        Open

                                                            public function date_box2($name, $selected = '', $years = '', $add_str = '', $show_what = 'ymd', $show_text = 1, $translate = 1)
                                                        Severity: Major
                                                        Found in plugins/html/classes/yf_html.class.php - About 50 mins to fix

                                                          Method radio_box has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                                          Open

                                                              public function radio_box($name, $values = [], $selected = '', $horizontal = true, $type = 2, $add_str = '', $translate = 0)
                                                          Severity: Major
                                                          Found in plugins/html/classes/yf_html.class.php - About 50 mins to fix

                                                            Method date_box has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                                            Open

                                                                public function date_box($selected = '', $years = '', $name_postfix = '', $add_str = '', $show_what = 'ymd', $show_text = 1, $translate = 1)
                                                            Severity: Major
                                                            Found in plugins/html/classes/yf_html.class.php - About 50 mins to fix

                                                              Method datetime_box2 has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                                              Open

                                                                  public function datetime_box2($name, $selected = '', $years = '', $add_str = '', $show_what = 'ymd', $show_text = 1, $translate = 1)
                                                              Severity: Major
                                                              Found in plugins/html/classes/yf_html.class.php - About 50 mins to fix

                                                                Function select2_box has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                    public function select2_box($name, $values = [], $selected = '', $extra = [])
                                                                    {
                                                                        $css = [];
                                                                        $style = [];
                                                                        if (is_array($name)) {
                                                                Severity: Minor
                                                                Found in plugins/html/classes/yf_html.class.php - About 45 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 country has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                    public function country()
                                                                    {
                                                                        asset('bfh-select');
                                                                
                                                                        $args = func_get_args();
                                                                Severity: Minor
                                                                Found in plugins/html/classes/yf_html.class.php - About 45 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 grid has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                    public function grid($data = [], $extra = [])
                                                                    {
                                                                        $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
                                                                        $rows = [];
                                                                        $ul_opened = false;
                                                                Severity: Minor
                                                                Found in plugins/html/classes/yf_html.class.php - About 45 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

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

                                                                    public function check_box($name = '', $value = '', $selected = '', $add_str = '', $extra = [])
                                                                Severity: Minor
                                                                Found in plugins/html/classes/yf_html.class.php - About 35 mins to fix

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

                                                                      public function time_box2($name, $selected = '', $add_str = '', $show_text = 1, $translate = 1)
                                                                  Severity: Minor
                                                                  Found in plugins/html/classes/yf_html.class.php - About 35 mins to fix

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

                                                                        public function time_box($selected = '', $name_postfix = '', $add_str = '', $show_text = 1, $translate = 1)
                                                                    Severity: Minor
                                                                    Found in plugins/html/classes/yf_html.class.php - About 35 mins to fix

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

                                                                          public function div_box($name, $values = [], $selected = '', $extra = [])
                                                                          {
                                                                              if (is_array($name)) {
                                                                                  $extra = (array) $extra + $name;
                                                                                  $name = $extra['name'];
                                                                      Severity: Minor
                                                                      Found in plugins/html/classes/yf_html.class.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 check_box has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                          public function check_box($name = '', $value = '', $selected = '', $add_str = '', $extra = [])
                                                                          {
                                                                              if (is_array($name)) {
                                                                                  $extra = (array) $extra + $name;
                                                                                  $name = $extra['name'];
                                                                      Severity: Minor
                                                                      Found in plugins/html/classes/yf_html.class.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 accordion has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                          public function accordion($data = [], $extra = [])
                                                                          {
                                                                              $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
                                                                              $items = [];
                                                                              foreach ((array) $data as $k => $v) {
                                                                      Severity: Minor
                                                                      Found in plugins/html/classes/yf_html.class.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 carousel has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                          public function carousel($data = [], $extra = [])
                                                                          {
                                                                              $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
                                                                              $items = [];
                                                                              $headers = [];
                                                                      Severity: Minor
                                                                      Found in plugins/html/classes/yf_html.class.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 pagination has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                          public function pagination($data = [], $extra = [])
                                                                          {
                                                                              $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
                                                                              if (isset($data['prev'])) {
                                                                                  $prev = $data['prev'];
                                                                      Severity: Minor
                                                                      Found in plugins/html/classes/yf_html.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 thumbnails has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                          public function thumbnails($data = [], $extra = [])
                                                                          {
                                                                              $items = [];
                                                                              $columns = (int) $extra['columns'] ?: 3;
                                                                              $row_class = 'span' . round(12 / $columns) . ' col-md-' . round(12 / $columns);
                                                                      Severity: Minor
                                                                      Found in plugins/html/classes/yf_html.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 simple_table has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                          public function simple_table($replace = [], $extra = [])
                                                                          {
                                                                              if ( ! $replace) {
                                                                                  return false;
                                                                              }
                                                                      Severity: Minor
                                                                      Found in plugins/html/classes/yf_html.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 _count_levels has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                          public function _count_levels($start_id = 0, &$children, $level = 0)
                                                                          {
                                                                              $ids = [];
                                                                              foreach ((array) $children[$start_id] as $id => $_tmp) {
                                                                                  $ids[$id] = $level;
                                                                      Severity: Minor
                                                                      Found in plugins/html/classes/yf_html.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 ip has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                          public function ip()
                                                                          {
                                                                              asset('bfh-select');
                                                                      
                                                                              $args = func_get_args();
                                                                      Severity: Minor
                                                                      Found in plugins/html/classes/yf_html.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

                                                                      Identical blocks of code found in 2 locations. Consider refactoring.
                                                                      Open

                                                                              foreach ((array) $values as $key => $cur_value) {
                                                                                  $_what_compare = (string) ($type == 1 ? $cur_value : $key);
                                                                                  $is_selected = $_what_compare == $selected;
                                                                                  $val = ($translate ? t($cur_value) : $cur_value);
                                                                                  $items[] = '<li class="dropdown' . ($is_selected ? ' active' : '') . '"><a data-value="' . $key . '"' . ($is_selected ? ' data-selected="selected"' : '') . '>' . $val . '</a></li>';
                                                                      Severity: Major
                                                                      Found in plugins/html/classes/yf_html.class.php and 1 other location - About 2 hrs to fix
                                                                      plugins/html/classes/yf_html.class.php on lines 1494..1502

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

                                                                      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

                                                                      Identical blocks of code found in 2 locations. Consider refactoring.
                                                                      Open

                                                                              foreach ((array) $values as $key => $cur_value) {
                                                                                  $_what_compare = (string) ($type == 1 ? $cur_value : $key);
                                                                                  $is_selected = $_what_compare == $selected;
                                                                                  $val = $translate ? t($cur_value) : $cur_value;
                                                                                  $items[] = '<li class="dropdown' . ($is_selected ? ' active' : '') . '"><a data-value="' . $key . '"' . ($is_selected ? ' data-selected="selected"' : '') . '>' . $val . '</a></li>';
                                                                      Severity: Major
                                                                      Found in plugins/html/classes/yf_html.class.php and 1 other location - About 2 hrs to fix
                                                                      plugins/html/classes/yf_html.class.php on lines 1446..1454

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

                                                                      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 2 locations. Consider refactoring.
                                                                      Open

                                                                                  if (is_array($selected)) {
                                                                                      if ($type == 1) {
                                                                                          $sel_text = in_array($value, $selected) ? 'checked="checked"' : '';
                                                                                      } else {
                                                                                          $sel_text = isset($selected[$key]) ? 'checked="checked"' : '';
                                                                      Severity: Major
                                                                      Found in plugins/html/classes/yf_html.class.php and 1 other location - About 2 hrs to fix
                                                                      plugins/html/classes/yf_html.class.php on lines 1005..1016

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

                                                                      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 2 locations. Consider refactoring.
                                                                      Open

                                                                                      if (is_array($selected)) {
                                                                                          if ($type == 1) {
                                                                                              $sel_text = in_array($key, $selected) ? 'selected="selected"' : '';
                                                                                          } else {
                                                                                              $sel_text = isset($selected[$key]) ? 'selected="selected"' : '';
                                                                      Severity: Major
                                                                      Found in plugins/html/classes/yf_html.class.php and 1 other location - About 2 hrs to fix
                                                                      plugins/html/classes/yf_html.class.php on lines 1306..1317

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

                                                                      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 2 locations. Consider refactoring.
                                                                      Open

                                                                          public function button_allow_deny_box($name, $values = [], $selected = null)
                                                                          {
                                                                              $def_cls = $this->CLASS_LABEL_BTN_RADIO;
                                                                              $values = [
                                                                                  ['class' => $def_cls . ' btn-warning', 'html' => '<i class="fa fa-ban"></i> ' . t('Deny') . '</span>'],
                                                                      Severity: Major
                                                                      Found in plugins/html/classes/yf_html.class.php and 1 other location - About 2 hrs to fix
                                                                      plugins/html/classes/yf_html.class.php on lines 1046..1054

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

                                                                      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 2 locations. Consider refactoring.
                                                                      Open

                                                                          public function button_yes_no_box($name, $values = [], $selected = null)
                                                                          {
                                                                              $def_cls = $this->CLASS_LABEL_BTN_RADIO;
                                                                              $values = [
                                                                                  ['class' => $def_cls . ' btn-warning', 'html' => '<i class="fa fa-ban"></i> ' . t('No') . '</span>'],
                                                                      Severity: Major
                                                                      Found in plugins/html/classes/yf_html.class.php and 1 other location - About 2 hrs to fix
                                                                      plugins/html/classes/yf_html.class.php on lines 1061..1069

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

                                                                      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

                                                                      Identical blocks of code found in 2 locations. Consider refactoring.
                                                                      Open

                                                                              if ($show_text && $level == 0) {
                                                                                  $def_opt_text = $show_text;
                                                                                  if ($show_text == 1) {
                                                                                      $def_opt_text = str_replace(['%name%', '%select%'], [t($name), t('Select')], $this->SELECT_BOX_DEF_OPT_TPL);
                                                                                  }
                                                                      Severity: Major
                                                                      Found in plugins/html/classes/yf_html.class.php and 1 other location - About 1 hr to fix
                                                                      plugins/html/classes/yf_html.class.php on lines 906..912

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

                                                                      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

                                                                      Identical blocks of code found in 2 locations. Consider refactoring.
                                                                      Open

                                                                              if ($show_text && $level == 0) {
                                                                                  $def_opt_text = $show_text;
                                                                                  if ($show_text == 1) {
                                                                                      $def_opt_text = str_replace(['%name%', '%select%'], [t($name), t('Select')], $this->SELECT_BOX_DEF_OPT_TPL);
                                                                                  }
                                                                      Severity: Major
                                                                      Found in plugins/html/classes/yf_html.class.php and 1 other location - About 1 hr to fix
                                                                      plugins/html/classes/yf_html.class.php on lines 990..996

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

                                                                      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

                                                                      Identical blocks of code found in 6 locations. Consider refactoring.
                                                                      Open

                                                                          public function _count_levels($start_id = 0, &$children, $level = 0)
                                                                          {
                                                                              $ids = [];
                                                                              foreach ((array) $children[$start_id] as $id => $_tmp) {
                                                                                  $ids[$id] = $level;
                                                                      Severity: Major
                                                                      Found in plugins/html/classes/yf_html.class.php and 5 other locations - About 1 hr to fix
                                                                      plugins/categories/admin_modules/yf_category_editor.class.php on lines 540..552
                                                                      plugins/categories/classes/yf_cats.class.php on lines 137..149
                                                                      plugins/content/admin_modules/yf_manage_faq.class.php on lines 367..379
                                                                      plugins/sys/admin_modules/yf_menus_editor.class.php on lines 573..585
                                                                      plugins/sys/classes/yf_core_menu.class.php on lines 456..468

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

                                                                      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

                                                                      Identical blocks of code found in 2 locations. Consider refactoring.
                                                                      Open

                                                                          public function multi_select_box($name, $values = [], $selected = '', $show_text = false, $type = 2, $add_str = '', $translate = 0, $level = 0, $disabled = false)
                                                                          {
                                                                              return $this->multi_select($name, $values, $selected, $show_text, $type, $add_str, $translate, $level, $disabled);
                                                                          }
                                                                      Severity: Minor
                                                                      Found in plugins/html/classes/yf_html.class.php and 1 other location - About 45 mins to fix
                                                                      plugins/common/classes/yf_common.class.php on lines 376..379

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

                                                                      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 2 locations. Consider refactoring.
                                                                      Open

                                                                                  if (is_array($value)) {
                                                                                      $body[] = '<optgroup label="' . $key . '" title="' . ($translate ? t($key) : $key) . '">';
                                                                                      $body[] = $this->$self_func($name, $value, $selected, $show_text, $type, $add_str, $translate, $level + 1);
                                                                                      $body[] = '</optgroup>';
                                                                                  } else {
                                                                      Severity: Minor
                                                                      Found in plugins/html/classes/yf_html.class.php and 1 other location - About 30 mins to fix
                                                                      plugins/html/classes/yf_html.class.php on lines 917..930

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

                                                                      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 2 locations. Consider refactoring.
                                                                      Open

                                                                                  if (is_array($cur_value)) {
                                                                                      $body[] = '<optgroup label="' . $key . '" title="' . ($translate ? t($key) : $key) . '">';
                                                                                      $body[] = $this->$self_func($name, $cur_value, $selected, $show_text, $type, $add_str, $translate, $level + 1);
                                                                                      $body[] = '</optgroup>';
                                                                                  } else {
                                                                      Severity: Minor
                                                                      Found in plugins/html/classes/yf_html.class.php and 1 other location - About 30 mins to fix
                                                                      plugins/html/classes/yf_html.class.php on lines 999..1018

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

                                                                      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

                                                                      There are no issues that match your filters.

                                                                      Category
                                                                      Status