Delete::issue()   A
last analyzed

Complexity

Conditions 2
Paths 4

Size

Total Lines 17

Duplication

Lines 17
Ratio 100 %

Importance

Changes 0
Metric Value
cc 2
nc 4
nop 0
dl 17
loc 17
rs 9.7
c 0
b 0
f 0
1
<?php
2
3
namespace Integrations\Connectors\SenhorVerdugo;
4
5
use Log;
6
use App\Models\Project as ProjectModel;
7
use SenhorVerdugoRestApi\Project\ProjectService;
8
use SenhorVerdugoRestApi\SenhorVerdugoException;
9
10
class Delete extends SenhorVerdugo
11
{
12 View Code Duplication
    public function watchFromIssue()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
    {
14
        $issueKey = 'TEST-961';
15
16
        try {
17
            $issueService = new IssueService();
18
            
19
            // watcher's id
20
            $watcher = 'lesstif';
21
            
22
            $issueService->removeWatcher($issueKey, $watcher);
23
            
24
        } catch (SenhorVerdugoException $e) {
0 ignored issues
show
Bug introduced by
The class SenhorVerdugoRestApi\SenhorVerdugoException does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
25
            $this->assertTrue(false, 'add watcher Failed : '.$e->getMessage());
26
        }
27
    }
28
29
    public function comment()
30
    {
31
        $issueKey = "TEST-879";
32
33
        try {
34
            $commentId = 12345;
35
36
            $issueService = new IssueService();
37
38
            $ret = $issueService->deleteComment($issueKey, $commentId);
0 ignored issues
show
Unused Code introduced by
$ret is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
39
40
        } catch (SenhorVerdugoException $e) {
0 ignored issues
show
Bug introduced by
The class SenhorVerdugoRestApi\SenhorVerdugoException does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
41
            $this->assertTrue(false, 'Delete comment Failed : '.$e->getMessage());
42
        }
43
44
    }
45
46 View Code Duplication
    public function issue()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
47
    {
48
49
        $issueKey = "TEST-879";
50
51
        try {
52
            $issueService = new IssueService();
53
54
            $ret = $issueService->deleteIssue($issueKey);
55
            // if you want to delete issues with sub-tasks
56
            //$ret = $issueService->deleteIssue($issueKey, array('deleteSubtasks' => 'true'));
57
58
            var_dump($ret);
0 ignored issues
show
Security Debugging Code introduced by
var_dump($ret); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
59
        } catch (SenhorVerdugoException $e) {
0 ignored issues
show
Bug introduced by
The class SenhorVerdugoRestApi\SenhorVerdugoException does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
60
            $this->assertTrue(false, "Change Assignee Failed : " . $e->getMessage());
61
        }
62
    }
63
64
    public function project(ProjectModel $project)
65
    {
66
        try {
67
            $proj = new ProjectService();
68
        
69
            $pj = $proj->deleteProject('EX');
70
           
71
            var_dump($pj);
0 ignored issues
show
Security Debugging Code introduced by
var_dump($pj); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
72
        } catch (SenhorVerdugoException $e) {
0 ignored issues
show
Bug introduced by
The class SenhorVerdugoRestApi\SenhorVerdugoException does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
73
            print("Error Occured! " . $e->getMessage());
74
        }
75
    }
76
}
77