Vulnerable Source Code Detection Using Sonarcloud Code Analysis 
Alifia Puspaningrum
a
, Muhammad Anis Al Hilmi
b
, Darsih, Muhamad Mustamiin  
and Maulana Ilham Ginanjar 
Department of Informatics, Politeknik Negeri Indramayu, Jalan Lohbener Lama No. 08, Indramayu, Indonesia 
Keywords:  Source Code, Detection, Vulnerability, Code Analysis, SonarCloud. 
Abstract:  In Software Development Life Cycle (SDLC), security vulnerabilities are one of the points introduced during 
the construction stage. Failure to detect software defects earlier after releasing the product to the market causes 
higher repair costs for the company. So, it decreases the company's  reputation,  violates  user  privacy,  and 
causes an unrepairable issue for the application. The introduction of vulnerability detection enables reducing 
the number of false alerts to focus the limited testing efforts on potentially vulnerable files. UMKM Masa 
Kini  (UMI)  is  a Point of Sales application  to  sell  any  Micro,  Small,  and  Medium  Enterprises  Product 
(UMKM).  Therefore,  in  the  current  work,  we  analyze  the  suitability  of  these  metrics  to  create  Machine 
Learning based software vulnerability detectors for UMI applications. Code is generated using a commercial 
tool, SonarCloud. Experimental result shows that there are 3,285 vulnerable rules detected.
1  INTRODUCTION 
In  Software  Development  Life  Cycle  (SDLC), 
security vulnerabilities being one of point introduced 
during  construction  stage.  However,  vulnerabilities 
being one of issue which difficult to be detected until 
it  becomes  apparent  as  security  failures  in  the 
operational  stage  of  SDLC.  (Kehagias,  Jankovic, 
Siavvas,  Gelenbe,  2021).  Failure  to  detect  software 
defect  earlier  after  releasing  product  to  the  market 
causes higher repairing cost for the company. So, it 
decreases company reputation, violate  user  privacy, 
and  cause  unrepairable  issue  for  the  application 
(Cisco,  2019).  In  addition,  techniques  to  detect 
software  vulnerabilities  are  needed before  releasing 
product (Shin,  Meneely,  Williams, Osborne, 2010). 
To solve those problems, dedicated tools are available 
on the market: e.g., Veracode (Veracode, 2020) and 
SonarCode (Raducu, Costales, Lera, Llamas, 2019). 
The introduction of vulnerability detection (usually a 
binary classification of vulnerable and neutral parts of 
the source code) enables reducing the number of false 
alerts to focus the limited testing efforts on potentially 
vulnerable files (Chowdhury, Zulkernine, 2010). 
UMKM  Masa  Kini  (UMI)  is  a  Point of Sales 
application to sell any kind Micro, Small and Medium 
 
a
 https://orcid.org/0000-0001-7179-8847  
b
 https://orcid.org/0000-0003-3696-0807  
Enterprises  Product  (UMKM).  Not  only  selling  the 
products,  UMI  also  provides  facilities  for  offline 
transaction  and  facilities  which  can  support  the 
development  of  UMKM.  However,  in  construction 
process, automated testing to detect vulnerable code 
is a good way to save money and time. Therefore, in 
the  current  work,  we  perform  an  analysis  of  the 
suitability  of  these  metrics  to  create  Machine 
Learning  based  software  vulnerability  detectors  for 
UMI  application.  Code  is  generated  using  a 
commercial tool, SonarCloud.  
2  LITERATURE REVIEW 
2.1  Software Testing 
Testing is an activity to evaluate software quality and 
to improve it (Pan, 1999). In general, testing divided 
into  two  namely  black  box  and  white  box  testing. 
White box is a testing technique that uses Software 
Under Test (SUT) or the software being tested as a 
test guide to be carried out (Touseef, Anwer, Hussain, 
Nadeem, 2015). In addition, Black Box Testing is not 
an  alternative  solution  to  White  Box  Testing  but  is