Kylob/BootPress

View on GitHub

Showing 144 of 16,700 total issues

Method listUsers has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static function listUsers($view)
    {
        extract(Admin::params('bp', 'page', 'auth', 'website'));
        $page->title = 'View Users at '.$website;
        $html = '';
Severity: Major
Found in src/Admin/Pages/Users.php - About 3 hrs to fix

    Method page has 86 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function page()
        {
            $page = Page::html();
            $get = $page->request->query->all();
            if ($page->get('adminer') == 'css') {
    Severity: Major
    Found in src/Admin/Pages/Databases.php - About 3 hrs to fix

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

          private static function exec($action, $table, $values = null)
          {
              $action = strtolower($action);
              if (!isset(self::$stmt[$action][$table])) {
                  switch ($action) {
      Severity: Minor
      Found in src/Analytics/Component.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 process has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function process()
          {
              $page = Page::html();
              $file = $page->file('analytics.csv');
              $temp = $page->file('analytics-temp.csv');
      Severity: Minor
      Found in src/Analytics/Component.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 page has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function page()
          {
              extract(Admin::params('bp', 'page'));
              $html = '';
      
      
      Severity: Minor
      Found in src/Admin/Pages/Code.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

      Method setup has 81 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function setup(Auth $auth, Blog $blog, array $map)
          {
              $html = '';
              if (!isset(static::$version['bootstrap'])) {
                  return $html;
      Severity: Major
      Found in src/Admin/Component.php - About 3 hrs to fix

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

            private function visitors()
            {
                extract(Admin::params('bp', 'website', 'page', 'path', 'admin'));
                $page->title = 'Visitors at '.$website;
                $html = '';
        Severity: Minor
        Found in src/Admin/Pages/Analytics.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

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

            public function __call($method, $arguments)
            {
                switch ($method) {
                    case 'start':
                        if (self::$debugbar->hasCollector('time')) {
        Severity: Minor
        Found in src/DebugBar/Component.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

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

            private function startStop($count, $range, $label = 'Y-m-d H:i:s', array $values = array())
            {
                $array = array();
                $range = substr($range, 0, 3);
                if (in_array($range, array('sec', 'min', 'hou', 'day', 'wee', 'mon', 'yea'))) {
        Severity: Minor
        Found in src/Admin/Pages/Analytics.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 page has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function page()
            {
                extract(Admin::params('bp', 'page'));
                $html = '';
        
        
        Severity: Major
        Found in src/Admin/Pages/Code.php - About 2 hrs to fix

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

              public static function save(array $files, array $remove = array())
              {
                  $page = Page::html();
                  if (($retrieve = $page->post('retrieve')) && isset($files[$retrieve])) {
                      exit(is_file($files[$retrieve]) ? file_get_contents($files[$retrieve]) : '');
          Severity: Major
          Found in src/Admin/Files.php - About 2 hrs to fix

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

                public static function database()
                {
                    $page = Page::html();
                    $db = new SQLite($page->file('Analytics.db'));
                    if ($db->created || version_compare(self::VERSION, $db->settings('version'), '>')) {
            Severity: Major
            Found in src/Analytics/Component.php - About 2 hrs to fix

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

              function display_wyciwyg (classes, data, retrieve, file, line, col) {
                  acefile.compare = data;
                  $("#toolbar div.file").text(file);
                  $("#toolbar div.status").hide();
                  if (classes.hasClass("noMarkup")) {
              Severity: Minor
              Found in src/Admin/Pages/admin/wyciwyg.js - 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 collect has 67 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function collect()
                  {
                      // return array();
              
                      $responseHeaders = $this->response->headers->all();
              Severity: Major
              Found in src/DebugBar/Collector/BootPress.php - About 2 hrs to fix

                Method exec has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private static function exec($action, $table, $values = null)
                    {
                        $action = strtolower($action);
                        if (!isset(self::$stmt[$action][$table])) {
                            switch ($action) {
                Severity: Major
                Found in src/Analytics/Component.php - About 2 hrs to fix

                  Method wyciwyg has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function wyciwyg()
                      {
                          extract(self::params('bp', 'page', 'plugin'));
                          $html = "\n\n".<<<EOT
                  <div id="wyciwyg" style="display:none; width:100%; padding:0 10px;">
                  Severity: Major
                  Found in src/Admin/Component.php - About 2 hrs to fix

                    Function display_wyciwyg has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function display_wyciwyg (classes, data, retrieve, file, line, col) {
                        acefile.compare = data;
                        $("#toolbar div.file").text(file);
                        $("#toolbar div.status").hide();
                        if (classes.hasClass("noMarkup")) {
                    Severity: Major
                    Found in src/Admin/Pages/admin/wyciwyg.js - About 2 hrs to fix

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

                          public static function sidebar($links, $prepend = false)
                          {
                              if (is_array($links)) {
                                  $page = Page::html();
                                  foreach ($links as $name => $path) {
                      Severity: Minor
                      Found in src/Admin/Component.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

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

                          public static function box($style, array $contents)
                          {
                              $box = '';
                              $classes = 'box box-'.implode(' box-', explode(' ', $style)); // solid, default, primary, info, warning, success, danger
                              foreach ($contents as $section => $value) {
                      Severity: Minor
                      Found in src/Admin/Component.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

                      Function blueimpFileUploader has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          $.fn.blueimpFileUploader = function(options) {
                              var action = $(this).closest('form').attr('action');
                              var field = $(this).attr('id');
                              var settings = $.extend({
                                  'size': 0,
                      Severity: Major
                      Found in src/Upload/uploader.js - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language