Issues (25)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/Profiling/StatsdProfiler.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace WZRD\Profiling;
4
5
use League\StatsD\Client as Statsd;
6
use WZRD\Contracts\Profiling\Profiler;
7
8
class StatsdProfiler implements Profiler
9
{
10
    /**
11
     * StatsD instance.
12
     *
13
     * @var League\StatsD\Client
14
     */
15
    private $statsd;
16
17
    /**
18
     * Initialize measurer with StatsD instance.
19
     *
20
     * @param League\StatsD\Client $statsd
21
     */
22
    public function __construct(Statsd $statsd)
23
    {
24
        $this->statsd = $statsd;
0 ignored issues
show
Documentation Bug introduced by
It seems like $statsd of type object<League\StatsD\Client> is incompatible with the declared type object<WZRD\Profiling\League\StatsD\Client> of property $statsd.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
25
    }
26
27
    /**
28
     * Increment a metric.
29
     *
30
     * @param string|array $metrics    Metric(s) to increment
31
     * @param int          $delta      Value to decrement the metric by
32
     * @param int          $sampleRate Sample rate of metric
33
     *
34
     * @return bool True if data transfer is successful
35
     */
36
    public function increment($metrics, $delta = 1, $sampleRate = 1)
37
    {
38
        return $this->statsd->increment($metrics, $delta, $sampleRate);
39
    }
40
41
    /**
42
     * Decrement a metric.
43
     *
44
     * @param string|array $metrics    Metric(s) to decrement
45
     * @param int          $delta      Value to increment the metric by
46
     * @param int          $sampleRate Sample rate of metric
47
     *
48
     * @return bool True if data transfer is successful
49
     */
50
    public function decrement($metrics, $delta = 1, $sampleRate = 1)
51
    {
52
        return $this->statsd->decrement($metrics, $delta, $sampleRate);
53
    }
54
55
    /**
56
     * Timing.
57
     *
58
     * @param string $metric Metric to track
59
     * @param float  $time   Time in milliseconds
60
     *
61
     * @return bool True if data transfer is successful
62
     */
63
    public function timing($metric, $time)
64
    {
65
        return $this->statsd->timing($metric, $time);
66
    }
67
68
    /**
69
     * Time a function.
70
     *
71
     * @param string   $metric Metric to time
72
     * @param callable $func   Function to record
73
     *
74
     * @return bool True if data transfer is successful
75
     */
76
    public function time($metric, $func)
77
    {
78
        return $this->statsd->time($metric, $func);
79
    }
80
81
    /**
82
     * Gauges.
83
     *
84
     * @param string $metric Metric to gauge
85
     * @param int    $value  Set the value of the gauge
86
     *
87
     * @return bool True if data transfer is successful
88
     */
89
    public function gauge($metric, $value)
90
    {
91
        return $this->statsd->gauge($metric, $value);
92
    }
93
94
    /**
95
     * Sets - count the number of unique values passed to a key.
96
     *
97
     * @param $metric
98
     * @param mixed $value
99
     *
100
     * @return bool True if data transfer is successful
101
     */
102
    public function set($metric, $value)
103
    {
104
        return $this->statsd->set($metric, $value);
105
    }
106
}
107