ADD SonarQube
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-08-31 14:57:21 +02:00
parent b6ab8dfd5a
commit 7834952385
21 changed files with 3257 additions and 0 deletions

View File

@@ -0,0 +1,337 @@
<EFBFBD>
HD:\Projects\Test\my-weather-api\Controllers\WeatherForecastController.cs
namespace 
my_weather_api

. 
Controllers $
;$ %
[ 
ApiController 
] 
[ 
Route 
( 
$str 
) 
] 
public 
class %
WeatherForecastController
&
:' (
ControllerBase) 7
{ 
private   
static   
readonly   
string   "
[  " #
]  # $
Summaries  % .
=  / 0
new  1 4
[  4 5
]  5 6
{

 
$str   
,   
$str   
,   
$str   '
,  ' (
$str  ) /
,  / 0
$str  1 7
,  7 8
$str  9 ?
,  ? @
$str  A H
,  H I
$str  J O
,  O P
$str  Q ]
,  ] ^
$str  _ j
}   
;   
private 
readonly 
ILogger 
< %
WeatherForecastController 6
>6 7
_logger8 ?
;? @
public
%
WeatherForecastController $
($ %
ILogger% ,
<, -%
WeatherForecastController- F
>F G
loggerH N
)N O
{ 
_logger 
= 
logger 
; 
} 
[ 
HttpGet 
(

Name

= 
$str (
)( )
]) *
public

IEnumerable 
< 
WeatherForecast &
>& '
Get( +
(+ ,
), -
{ 
return 
Enumerable 
. 
Range 
( 
$num !
,! "
$num# $
)$ %
.% &
Select& ,
(, -
index- 2
=>3 5
new6 9
WeatherForecast: I
{ 
Date 
= 
DateOnly 
. 
FromDateTime (
(( )
DateTime) 1
.1 2
Now2 5
.5 6
AddDays6 =
(= >
index> C
)C D
)D E
,E F
TemperatureC 
= 
Random !
.! "
Shared" (
.( )
Next) -
(- .
-. /
$num/ 1
,1 2
$num3 5
)5 6
,6 7
Summary 
= 
Summaries 
[ 
Random &
.& '
Shared' -
.- .
Next. 2
(2 3
Summaries3 <
.< =
Length= C
)C D
]D E
} 
)

. 
ToArray 
( 
) 
; 
} 
}  <01>
*D:\Projects\Test\my-weather-api\Program.cs
var 
builder 
=

WebApplication 
. 
CreateBuilder *
(* +
args+ /
)/ 0
;0 1
builder 
. 
Services 
. 
AddControllers 
( 
) !
;! "
builder 
. 
Services 
. #
AddEndpointsApiExplorer (
(( )
)) *
;* +
builder 
. 
Services 
. 
AddSwaggerGen 
( 
) 
; !
var


app

 
=

 
builder



.

 
Build

 
(

 
)

 
;

 
if


(

 
app

 
.

 
Environment

 
.

 
IsDevelopment

 !
(

! "
)

" #
)

# $
{ 
app 
. 
UseSwagger 
( 
) 
; 
app 
. 
UseSwaggerUI 
( 
) 
; 
} 
app 
. 
UseAuthorization 
( 
) 
; 
app 
. 
MapControllers 
( 
) 
; 
app 
. 
Run 
( 
) 
;
<EFBFBD>
2D:\Projects\Test\my-weather-api\WeatherForecast.cs
namespace 
my_weather_api

; 
public 
class 
WeatherForecast

{ 
public

DateOnly 
Date 
{ 
get 
; 
set #
;# $
}% &
public

int 
TemperatureC 
{ 
get !
;! "
set# &
;& '