suresh pondicherry
asked on
Fix sonarqube complaints for .net application
Hi,
Thanks!
This is regarding sonarqube complaint. I am using
Sonarqube is complaining "Remove this return statement or make it conditional" . Please help me how to fix this bug..
Kind regards,
Pooja
Thanks!
This is regarding sonarqube complaint. I am using
public async Task<(Guid, string, Guid)> GetAllCategories()
{
return (Guid.Parse(data["Id"].ToString()),
data["StatusName"].ToString(),
Guid.Parse(data["StatusId"].ToString())
);
}
Sonarqube is complaining "Remove this return statement or make it conditional" . Please help me how to fix this bug..
Kind regards,
Pooja
ASKER
Hi Sara,
I already tried that and still is giving the same report at return line.
Kind regards,
Pooja
I already tried that and still is giving the same report at return line.
Kind regards,
Pooja
How are you calling this method? What does that code look like?
can you try to using 3 tasks instead of one:
Sara
public async Task<Guid> GetAllCategoriesIdGuid()
{
Guid guidId = Guid.Parse(data["Id"].ToString()) ;
return guidId;
}
public async Task<string> GetAllCategoriesStatusName()
{
string statusId = data["StatusName"].ToString();
return statusId;
}
public async Task<Guid> GetAllCategoriesStatusIdGuid()
{
Guid guidStatusId = Guid.Parse(data["StatusId"].ToString());
return guidStatusId;
}
Sara
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
shouldn't make much difference but perhaps gives better error message.
Sara