Showing 886 of 3,221 total issues
Method SiteUpdate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<bool> SiteUpdate(int siteMicrotingUid, string siteName, string userFirstName,
string userLastName, string userEmail, string languageCode)
Method UnitRequestOtp
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public Task<string> UnitRequestOtp(int microtingUid, int siteId, bool newOtp, bool pushEnabled,
bool syncDelayEnabled, bool syncDialogEnabled)
Avoid deeply nested control flow statements. Open
Open
case Constants.Notifications.RetrievedForm:
_sqlController.NotificationCreate(notificationUId, microtingUId,
Constants.Notifications.RetrievedForm).GetAwaiter().GetResult();
_bus.SendLocal(new EformRetrieved(notificationUId, microtingUId)).GetAwaiter()
.GetResult();
Avoid deeply nested control flow statements. Open
Open
case Constants.Notifications.UnitActivate:
_sqlController.NotificationCreate(notificationUId, microtingUId,
Constants.Notifications.UnitActivate).GetAwaiter().GetResult();
_bus.SendLocal(new UnitActivated(notificationUId, microtingUId)).GetAwaiter()
.GetResult();
Avoid deeply nested control flow statements. Open
Open
case Constants.Notifications.SpeechToTextCompleted:
_sqlController.NotificationCreate(notificationUId, microtingUId,
Constants.Notifications.SpeechToTextCompleted).GetAwaiter().GetResult();
_bus.SendLocal(new TranscriptionCompleted(notificationUId, microtingUId))
.GetAwaiter().GetResult();
Avoid deeply nested control flow statements. Open
Open
case Constants.Notifications.InSightAnswerDone:
_sqlController.NotificationCreate(notificationUId, microtingUId,
Constants.Notifications.InSightAnswerDone).GetAwaiter().GetResult();
_bus.SendLocal(new AnswerCompleted(notificationUId, microtingUId)).GetAwaiter()
.GetResult();
Method UnitUpdate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<string> UnitUpdate(int id, bool newOtp, int siteId, bool pushEnabled, bool syncDelayEnabled,
bool syncDialogEnabled)
Method CaseToPdf
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public Task<string> CaseToPdf(int caseId, string jasperTemplate, string timeStamp,
string customPathForUploadedData, string customXmlContent, Language language)
Method CreateSubTemplate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<CheckList> CreateSubTemplate(string label, string description, string caseType,
int displayIndex, int repeated, CheckList parentId)
Method UnitUpdate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<string> UnitUpdate(int id, bool newOtp, int siteId, bool pushEnabled, bool syncDelayEnabled,
bool syncDialogEnabled)
Avoid deeply nested control flow statements. Open
Open
case Constants.Notifications.EformParsingError:
_bus.SendLocal(new EformParsingError(notificationUId, microtingUId))
.GetAwaiter().GetResult();
break;
Avoid deeply nested control flow statements. Open
Open
if (resp.Checks.Count > 0)
{
await SaveResult(resp, respXml, dbContext, microtingUid, null, aCase)
.ConfigureAwait(false);
noResults = false;
Method SaveResult
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private async Task<int> SaveResult(Response resp, string respXml, MicrotingDbContext dbContext,
int microtingUid, int? checkIdLastKnown, CaseDto aCase)
Method UnitUpdate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
Task<string> UnitUpdate(int id, bool newOtp, int siteId, bool pushEnabled, bool syncDelayEnabled,
bool syncDialogEnabled);
Avoid deeply nested control flow statements. Open
Open
case Constants.Notifications.Completed:
_sqlController.NotificationCreate(notificationUId, microtingUId,
Constants.Notifications.Completed).GetAwaiter().GetResult();
_bus.SendLocal(new EformCompleted(notificationUId, microtingUId)).GetAwaiter()
.GetResult();
Method CreateSpecialOption
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private async Task CreateSpecialOption(MicrotingDbContext dbContext, int weight, int weightedValue, string text,
int languageId, int optionIndex)
Avoid deeply nested control flow statements. Open
Open
case Constants.Notifications.EformParsedByServer:
_bus.SendLocal(new EformParsedByServer(notificationUId, microtingUId))
.GetAwaiter().GetResult();
break;
Method Close
has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring. Open
Open
public async Task<bool> Close()
#pragma warning restore 1998
{
string methodName = "Core.Close";
Log.LogStandard(methodName, "Close called");
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
Open
if (hash != null)
{
//rename local file
FileInfo fileInfo = new FileInfo(filePathAndFileName);
Avoid deeply nested control flow statements. Open
Open
if (value.Tag == ExifTag.Orientation)
{
if (unit.Manufacturer == "iOS")
{
Console.WriteLine($"rotate value is {value.GetValue()}");