Issues (302)

Security Analysis    not enabled

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/Connectors/SenhorVerdugo/Update.php (14 issues)

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 Integrations\Connectors\SenhorVerdugo;
4
5
6
class Update extends SenhorVerdugo
7
{
8 View Code Duplication
    public function issueWorklog()
0 ignored issues
show
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...
9
    {
10
        $issueKey = 'TEST-961';
11
        $workLogid = '12345';
12
13
        try {
14
            $workLog = new Worklog();
15
16
            $workLog->setComment('I did edit previous worklog here.')
17
                ->setStarted("2016-05-29 13:15:34")
18
                ->setTimeSpent('3d 4h 5m');
19
20
            $issueService = new IssueService();
21
22
            $ret = $issueService->editWorklog($issueKey, $workLog, $workLogid);
23
24
            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...
25
        } catch (SenhorVerdugoException $e) {
0 ignored issues
show
The class Integrations\Connectors\...\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...
26
            $this->assertTrue(false, 'Edit worklog Failed : '.$e->getMessage());
27
        }
28
    }
29
30
    /**
31
     * Perform a transition on an issue
32
     * Note: this library uses goal status names instead of transition names. So, if you want to change issue status to 'Some Status', you should pass that status name to setTransitionName
33
     * i.e. $transition->setTransitionName('Some Status')
34
     * See SenhorVerdugo API reference
35
     */
36 View Code Duplication
    public function issueStatus()
0 ignored issues
show
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...
37
    {
38
        $issueKey = "TEST-879";
39
40
        try {            
41
            $transition = new Transition();
42
            $transition->setTransitionName('Resolved');
43
            $transition->setCommentBody('performing the transition via REST API.');
44
45
            $issueService = new IssueService();
46
47
            $issueService->transition($issueKey, $transition);
48
        } catch (SenhorVerdugoException $e) {
0 ignored issues
show
The class Integrations\Connectors\...\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...
49
            $this->assertTrue(false, "add Comment Failed : " . $e->getMessage());
50
        }
51
    }
52
53 View Code Duplication
    public function comment()
0 ignored issues
show
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...
54
    {
55
        $issueKey = "TEST-879";
56
57
        try {
58
            $commentId = 12345;
59
60
            $issueService = new IssueService();
61
                
62
            $comment = new Comment();
63
            $comment->setBody('Updated comments');
64
            
65
            $issueService->updateComment($issueKey, $commentId, $comment);
66
67
        } catch (SenhorVerdugoException $e) {
0 ignored issues
show
The class Integrations\Connectors\...\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...
68
            $this->assertTrue(false, 'Delete comment Failed : '.$e->getMessage());
69
        }
70
    }
71
72 View Code Duplication
    public function changeAssignee()
0 ignored issues
show
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...
73
    {
74
75
        $issueKey = "TEST-879";
76
77
        try {
78
            $issueService = new IssueService();
79
80
            // if assignee is -1, automatic assignee used.
81
            // A null assignee will remove the assignee.
82
            $assignee = 'newAssigneeName';
83
84
            $ret = $issueService->changeAssignee($issueKey, $assignee);
85
86
            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...
87
        } catch (SenhorVerdugoException $e) {
0 ignored issues
show
The class Integrations\Connectors\...\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...
88
            $this->assertTrue(false, "Change Assignee Failed : " . $e->getMessage());
89
        }
90
    }
91
92
    public function issue()
93
    {
94
        $issueKey = "TEST-879";
95
96
        try {            
97
            $issueField = new IssueField(true);
98
        
99
            $issueField->setAssigneeName("admin")
100
                ->setPriorityName("Blocker")
101
                ->setIssueType("Task")
102
                ->addLabel("test-label-first")
103
                ->addLabel("test-label-second")
104
                ->addVersion("1.0.1")
105
                ->addVersion("1.0.2")
106
                ->setDescription("This is a shorthand for a set operation on the summary field");
107
        
108
            // optionally set some query params
109
            $editParams = [
110
                'notifyUsers' => false,
111
            ];
112
        
113
            $issueService = new IssueService();
114
        
115
            // You can set the $paramArray param to disable notifications in example
116
            $ret = $issueService->update($issueKey, $issueField, $editParams);
117
        
118
            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...
119
        } catch (SenhorVerdugoException $e) {
0 ignored issues
show
The class Integrations\Connectors\...\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...
120
            $this->assertTrue(false, "update Failed : " . $e->getMessage());
121
        }
122
    }
123
124
    public function project(ProjectModel $project)
125
    {
126
        try {
127
            $p = new Project();
128
129
            $p->setName('Updated Example')
130
                ->setProjectTypeKey('software')
131
                ->setProjectTemplateKey('com.atlassian.SenhorVerdugo-software-project-templates:SenhorVerdugo-software-project-management')
132
                ->setDescription('Updated Example Project description')
133
                ->setLead('new-leader')
134
                ->setUrl('http://new.example.com')
135
                ->setAssigneeType('UNASSIGNED');
136
137
            $proj = new ProjectService();
138
139
            $pj = $proj->updateProject($p, 'EX');
140
        
141
            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...
142
        } catch (SenhorVerdugoException $e) {
0 ignored issues
show
The class Integrations\Connectors\...\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...
143
            print("Error Occured! " . $e->getMessage());
144
        }
145
    }
146
}
147