Showing 886 of 3,221 total issues
Method EntityGroupAll
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<EntityGroupList> EntityGroupAll(string sort, string nameFilter, int offSet, int pageSize,
string entityType, bool desc, string workflowState)
Method Advanced_EntityGroupAll
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<EntityGroupList> Advanced_EntityGroupAll(string sort, string nameFilter, int pageIndex,
int pageSize, string entityType, bool desc, string workflowState)
Method CreateCheckListSite
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<CheckListSite> CreateCheckListSite(CheckList checklist, DateTime createdAt,
Site site, DateTime updatedAt, int version, string workflowState, int microting_uid)
Method CaseToJasperXml
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<string> CaseToJasperXml(CaseDto cDto, ReplyElement reply, int caseId, string timeStamp,
string customPathForUploadedData, string customXMLContent, Language language)
Method CaseToPdf
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<string> CaseToPdf(int caseId, string jasperTemplate, string timeStamp,
string customPathForUploadedData, string fileType, string customXmlContent, Language language)
Function create_github_issue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def create_github_issue(package_name, old_version, new_version):
# GitHub API URLs for creating an issue and adding labels
create_issue_url = f"https://api.github.com/repos/{GITHUB_REPO_OWNER}/{GITHUB_REPO_NAME}/issues"
add_labels_url = f"https://api.github.com/repos/{GITHUB_REPO_OWNER}/{GITHUB_REPO_NAME}/issues/{{issue_number}}/labels"
- 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 (newValue != "")
{
newValue += "\n" + value;
}
else
Avoid deeply nested control flow statements. Open
Open
if (dbFieldValue == null)
{
FieldValue fieldValue = new FieldValue
{
FieldId = subDbField.Id,
Avoid deeply nested control flow statements. Open
Open
if (fieldOption == null)
{
fieldOption = new FieldOption
{
FieldId = field.Id,
Avoid deeply nested control flow statements. Open
Open
if (dU == null)
{
dU = new Data.Entities.UploadedData
{
Extension = dataItemReply.Extension,
Avoid deeply nested control flow statements. Open
Open
if (!string.IsNullOrEmpty(extractedValue) && extractedValue != "null")
{
if (extractedValue.ToLower() == "true")
{
fieldV.Value = "checked";
Avoid deeply nested control flow statements. Open
Open
if (kvp.Key == item.CaseId.ToString())
{
if (item.UploadedDataId.HasValue)
{
Data.Entities.UploadedData uploadedData =
Avoid deeply nested control flow statements. Open
Open
if (!string.IsNullOrEmpty(extractedValue) && extractedValue != "null")
{
int id = EntityItemRead(extractedValue).GetAwaiter().GetResult().Id;
fieldV.Value = id.ToString();
}
Avoid deeply nested control flow statements. Open
Open
if (fieldV.FieldId == foo.Id)
{
eFormFieldList.RemoveAt(index);
break;
}
Avoid deeply nested control flow statements. Open
Open
if (fieldType.Type == Constants.Constants.FieldTypes.Number ||
fieldType.Type == Constants.Constants.FieldTypes.NumberStepper)
{
// extractedValue = extractedValue.Replace(",", "|"); // commented as of 8. oct. 2019
extractedValue = extractedValue.Replace(".", ",");
Avoid deeply nested control flow statements. Open
Open
if (fieldValue.ValueReadable != "")
{
fieldValue.ValueReadable += '|';
}
Avoid deeply nested control flow statements. Open
Open
if (currentTranslationText == translation.Text &&
currentTranslationDescription == translation.Description)
{
dbContext.FieldTranslations.Remove(translation);
await dbContext.SaveChangesAsync();
Avoid deeply nested control flow statements. Open
Open
if (uploadedData != null)
{
if (uploadedData.FileName != null)
locations += uploadedData.FileLocation + uploadedData.FileName +
Environment.NewLine;
Method CaseReadAll
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<List<Case>> CaseReadAll(int? templateId, DateTime? start, DateTime? end, string workflowState,
string searchKey, TimeZoneInfo timeZoneInfo)
Avoid deeply nested control flow statements. Open
Open
case Constants.Notifications.InSightSurveyConfigurationChanged:
case Constants.Notifications.InSightSurveyConfigurationCreated:
_sqlController.NotificationCreate(notificationUId, microtingUId,
Constants.Notifications.InSightSurveyConfigurationChanged).GetAwaiter()
.GetResult();