runcmf/runtracy

View on GitHub

Showing 32 of 36 total issues

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

    private function getServiceMap()
    {
        $result = [
            'transport' => 'POST',
            'envelope' => 'JSON-RPC-2.0',
Severity: Minor
Found in src/RunTracy/Helpers/Console/BaseJsonRpcServer.php - About 5 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method getMemoryChart has 119 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function getMemoryChart()
    {
        $colors = [
            'axis' => '#000000',
            'gridLines' => '#cccccc',
Severity: Major
Found in src/RunTracy/Helpers/ProfilerPanel.php - About 4 hrs to fix

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

        private function validateCall(\stdClass $call)
        {
            $result = null;
            $error = null;
            $data = null;
    Severity: Minor
    Found in src/RunTracy/Helpers/Console/BaseJsonRpcServer.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 __invoke has 99 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function __invoke(Request $request, Response $response, callable $next)
        {
            $res = $next($request, $response);
    
            $cookies = json_decode($request->getCookieParam('tracyPanelsEnabled'));
    Severity: Major
    Found in src/RunTracy/Middlewares/TracyMiddleware.php - About 3 hrs to fix

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

          public function completion($token, $environment, $pattern)
          {
              $result = $this->initialize($token, $environment);
              if ($result) {
                  return $result;
      Severity: Minor
      Found in src/RunTracy/Helpers/Console/WebConsoleRPCServer.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 __invoke has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

          public function __invoke(Request $request, Response $response, callable $next)
          {
              $res = $next($request, $response);
      
              $cookies = json_decode($request->getCookieParam('tracyPanelsEnabled'));
      Severity: Minor
      Found in src/RunTracy/Middlewares/TracyMiddleware.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

      File BaseJsonRpcServer.php has 316 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      namespace RunTracy\Helpers\Console;
      
      /**
      Severity: Minor
      Found in src/RunTracy/Helpers/Console/BaseJsonRpcServer.php - About 3 hrs to fix

        Method getPanel has 78 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getPanel()
            {
                $out = '
                <script>
                    function getSelectedTracyPanelCheckboxes() {
        Severity: Major
        Found in src/RunTracy/Helpers/PanelSelector.php - About 3 hrs to fix

          Method validateCall has 77 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function validateCall(\stdClass $call)
              {
                  $result = null;
                  $error = null;
                  $data = null;
          Severity: Major
          Found in src/RunTracy/Helpers/Console/BaseJsonRpcServer.php - About 3 hrs to fix

            Method getPanel has 77 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getPanel()
                {
                    $table = '
                    <style type="text/css">
                        .tracy-inner {
            Severity: Major
            Found in src/RunTracy/Helpers/ProfilerPanel.php - About 3 hrs to fix

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

                  public function execute()
                  {
                      $ret = [];
                      do {
                          // check for SMD Discovery request
              Severity: Minor
              Found in src/RunTracy/Helpers/Console/BaseJsonRpcServer.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 getServiceMap has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function getServiceMap()
                  {
                      $result = [
                          'transport' => 'POST',
                          'envelope' => 'JSON-RPC-2.0',
              Severity: Major
              Found in src/RunTracy/Helpers/Console/BaseJsonRpcServer.php - About 2 hrs to fix

                Method getTab has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getTab()
                    {
                        $this->icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 532 178" style="width: 35px"><path '.
                            'fill="#016301" d="m439 153.67c-13.839-3.3534-27.492-13.852-34.543-26.563-1.9832-3.575-4.8271-10.55-'.
                            '6.3198-15.5-2.4268-8.0476-2.7156-10.587-2.7288-24-0.0174-17.571 1.7519-25.761 8.271-38.287 7.21-13.853'.
                Severity: Major
                Found in src/RunTracy/Helpers/TwigPanel.php - About 2 hrs to fix

                  Method getTab has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getTab()
                      {
                          // Set blinker to work with no active panel
                          $head = '
                          <style type="text/css">
                  Severity: Minor
                  Found in src/RunTracy/Helpers/ConsolePanel.php - About 1 hr to fix

                    Method completion has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function completion($token, $environment, $pattern)
                        {
                            $result = $this->initialize($token, $environment);
                            if ($result) {
                                return $result;
                    Severity: Minor
                    Found in src/RunTracy/Helpers/Console/WebConsoleRPCServer.php - About 1 hr to fix

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

                          public function execute()
                          {
                              $ret = [];
                              do {
                                  // check for SMD Discovery request
                      Severity: Minor
                      Found in src/RunTracy/Helpers/Console/BaseJsonRpcServer.php - About 1 hr to fix

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

                            protected function authenticateToken($token)
                            {
                                if ($this->noLogin) {
                                    return true;
                                }
                        Severity: Minor
                        Found in src/RunTracy/Helpers/Console/WebConsoleRPCServer.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 getRequest has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function getRequest()
                            {
                                $error = null;
                        
                                do {
                        Severity: Minor
                        Found in src/RunTracy/Helpers/Console/BaseJsonRpcServer.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 getMetaData has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function getMetaData()
                            {
                                if (empty($this->metaData)) {
                                    $this->metaData[self::META_TIME_LINE] = [];
                                    $this->metaData[self::META_MEMORY_PEAK] = 0;
                        Severity: Minor
                        Found in src/RunTracy/Helpers/Profiler/ProfilerService.php - About 1 hr to fix

                          Method getPanel has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function getPanel()
                              {
                                  ob_start();
                                  phpinfo();
                                  $phpInfo = ob_get_contents();
                          Severity: Minor
                          Found in src/RunTracy/Helpers/PhpInfoPanel.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language