ExampleClass   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 1
b 0
f 0
dl 0
loc 16
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A flawedMethod() 0 6 2
1
<?php
2
3
class ExampleClass
4
{
5
    /** @var string */
6
    private string $msg;
7
8
    public function __construct(string $msg)
9
    {
10
        $this->msg = $msg;
11
    }
12
13
    public function flawedMethod()
14
    {
15
        try {
16
            new \NoSuchClass($this->message);
0 ignored issues
show
Bug introduced by
The type NoSuchClass was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
Bug Best Practice introduced by
The property message does not exist on ExampleClass. Did you maybe forget to declare it?
Loading history...
17
        } catch (Throwable $e) {
18
            throw new RuntimeException('Example Exception, follow how we got here.', 100, $e);
19
        }
20
    }
21
}
22