microting/eform-sdk-dotnet

View on GitHub

Showing 886 of 3,221 total issues

Method EntityGroupAll has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

        public async Task<EntityGroupList> EntityGroupAll(string sort, string nameFilter, int offSet, int pageSize,
            string entityType, bool desc, string workflowState)
Severity: Major
Found in eFormCore/Infrastructure/SqlController.cs - About 50 mins to fix

    Method Advanced_EntityGroupAll has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            public async Task<EntityGroupList> Advanced_EntityGroupAll(string sort, string nameFilter, int pageIndex,
                int pageSize, string entityType, bool desc, string workflowState)
    Severity: Major
    Found in eFormCore/Core.cs - About 50 mins to fix

      Method CreateCheckListSite has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              public async Task<CheckListSite> CreateCheckListSite(CheckList checklist, DateTime createdAt,
                  Site site, DateTime updatedAt, int version, string workflowState, int microting_uid)
      Severity: Major
      Found in eFormCore/Helpers/TestHelpers.cs - About 50 mins to fix

        Method CaseToJasperXml has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                public async Task<string> CaseToJasperXml(CaseDto cDto, ReplyElement reply, int caseId, string timeStamp,
                    string customPathForUploadedData, string customXMLContent, Language language)
        Severity: Major
        Found in eFormCore/Core.cs - About 50 mins to fix

          Method CaseToPdf has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  public async Task<string> CaseToPdf(int caseId, string jasperTemplate, string timeStamp,
                      string customPathForUploadedData, string fileType, string customXmlContent, Language language)
          Severity: Major
          Found in eFormCore/Core.cs - About 50 mins to fix

            Function create_github_issue has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            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"
                
            Severity: Minor
            Found in cronjob.py - About 45 mins to fix

            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

                                            if (newValue != "")
                                            {
                                                newValue += "\n" + value;
                                            }
                                            else
            Severity: Major
            Found in eFormCore/Infrastructure/SqlController.cs - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                                  if (dbFieldValue == null)
                                                  {
                                                      FieldValue fieldValue = new FieldValue
                                                      {
                                                          FieldId = subDbField.Id,
              Severity: Major
              Found in eFormCore/Infrastructure/SqlController.cs - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                if (fieldOption == null)
                                                {
                                                    fieldOption = new FieldOption
                                                    {
                                                        FieldId = field.Id,
                Severity: Major
                Found in eFormCore/Infrastructure/Data/Entities/Field.cs - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                  if (dU == null)
                                                  {
                                                      dU = new Data.Entities.UploadedData
                                                      {
                                                          Extension = dataItemReply.Extension,
                  Severity: Major
                  Found in eFormCore/Infrastructure/SqlController.cs - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                    if (!string.IsNullOrEmpty(extractedValue) && extractedValue != "null")
                                                    {
                                                        if (extractedValue.ToLower() == "true")
                                                        {
                                                            fieldV.Value = "checked";
                    Severity: Major
                    Found in eFormCore/Infrastructure/SqlController.cs - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                          if (kvp.Key == item.CaseId.ToString())
                                                          {
                                                              if (item.UploadedDataId.HasValue)
                                                              {
                                                                  Data.Entities.UploadedData uploadedData =
                      Severity: Major
                      Found in eFormCore/Infrastructure/SqlController.cs - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                        if (!string.IsNullOrEmpty(extractedValue) && extractedValue != "null")
                                                        {
                                                            int id = EntityItemRead(extractedValue).GetAwaiter().GetResult().Id;
                                                            fieldV.Value = id.ToString();
                                                        }
                        Severity: Major
                        Found in eFormCore/Infrastructure/SqlController.cs - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                          if (fieldV.FieldId == foo.Id)
                                                          {
                                                              eFormFieldList.RemoveAt(index);
                                                              break;
                                                          }
                          Severity: Major
                          Found in eFormCore/Infrastructure/SqlController.cs - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            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(".", ",");
                            Severity: Major
                            Found in eFormCore/Infrastructure/SqlController.cs - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                                  if (fieldValue.ValueReadable != "")
                                                                  {
                                                                      fieldValue.ValueReadable += '|';
                                                                  }
                              Severity: Major
                              Found in eFormCore/Infrastructure/SqlController.cs - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                                if (currentTranslationText == translation.Text &&
                                                                    currentTranslationDescription == translation.Description)
                                                                {
                                                                    dbContext.FieldTranslations.Remove(translation);
                                                                    await dbContext.SaveChangesAsync();
                                Severity: Major
                                Found in eFormCore/Infrastructure/Data/Entities/Field.cs - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                                  if (uploadedData != null)
                                                                  {
                                                                      if (uploadedData.FileName != null)
                                                                          locations += uploadedData.FileLocation + uploadedData.FileName +
                                                                                       Environment.NewLine;
                                  Severity: Major
                                  Found in eFormCore/Infrastructure/SqlController.cs - About 45 mins to fix

                                    Method CaseReadAll has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                            public async Task<List<Case>> CaseReadAll(int? templateId, DateTime? start, DateTime? end, string workflowState,
                                                string searchKey, TimeZoneInfo timeZoneInfo)
                                    Severity: Minor
                                    Found in eFormCore/Core.cs - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                                          case Constants.Notifications.InSightSurveyConfigurationChanged:
                                                                          case Constants.Notifications.InSightSurveyConfigurationCreated:
                                                                              _sqlController.NotificationCreate(notificationUId, microtingUId,
                                                                                      Constants.Notifications.InSightSurveyConfigurationChanged).GetAwaiter()
                                                                                  .GetResult();
                                      Severity: Major
                                      Found in eFormCore/Services/Subscriber.cs - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language