runcmf/runtracy

View on GitHub

Showing 36 of 36 total issues

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

    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 getTab has 35 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 480 480" version="1.1" width="16px" '.
                  'height="16px"><path fill="#043CBF" d="m221.25 479.1c-79.88-6.85-150.37-51.83-189.99-121.24-14.666-'.
                  '25.69-23.972-53.8-29.552-89.27-0.70825-4.5-1.1632-16.11-1.1384-29.06 0.04489-23.34 1.5027-35.94 6.5464'.
      Severity: Minor
      Found in src/RunTracy/Helpers/SlimRouterPanel.php - About 1 hr to fix

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

            protected function authenticateUser($user, $password)
            {
                $user = trim((string) $user);
                $password = trim((string) $password);
        
        
        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

        Method finish has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function finish($labelOrFormat = null, $args = null)
            {
                if (static::$enabled) {
                    $now = microtime(true);
        
        
        Severity: Minor
        Found in src/RunTracy/Helpers/Profiler/SimpleProfiler.php - About 1 hr to fix

          Method getRequest has 28 lines of code (exceeds 25 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

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

                private function processCall(\stdClass $call)
                {
                    $id = property_exists($call, 'id') ? $call->id : null;
                    $params = property_exists($call, 'params') ? $call->params : [];
                    $result = null;
            Severity: Minor
            Found in src/RunTracy/Helpers/Console/BaseJsonRpcServer.php - About 1 hr to fix

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

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

                  public function __construct(Container $c = null, $containerName = '')
                  {
                      if ($c === null || !$c->has($containerName)) {
                          return 0;
                      }
              Severity: Minor
              Found in src/RunTracy/Collectors/DoctrineCollector.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 finish has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function finish($labelOrFormat = null, $args = null)
                  {
                      if (static::$enabled) {
                          $now = microtime(true);
              
              
              Severity: Minor
              Found in src/RunTracy/Helpers/Profiler/SimpleProfiler.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 setEnvironment has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function setEnvironment($environment)
                  {
                      $environment = !empty($environment) ? (array) $environment : [];
                      $path = (isset($environment['path']) && !$this->isEmptyString($environment['path'])) ?
                          $environment['path'] : $this->homeDirectory;
              Severity: Minor
              Found in src/RunTracy/Helpers/Console/WebConsoleRPCServer.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 getMetaData has a Cognitive Complexity of 7 (exceeds 5 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 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 processCall has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function processCall(\stdClass $call)
                  {
                      $id = property_exists($call, 'id') ? $call->id : null;
                      $params = property_exists($call, 'params') ? $call->params : [];
                      $result = null;
              Severity: Minor
              Found in src/RunTracy/Helpers/Console/BaseJsonRpcServer.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 parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function parse($data)
                  {
                      $return = $this->getHeader();
                      $time = $cnt = 0;
                      foreach ($data as $var) {
              Severity: Minor
              Found in src/RunTracy/Helpers/EloquentORMPanel.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

              Severity
              Category
              Status
              Source
              Language