microting/eform-sdk-dotnet

View on GitHub

Showing 886 of 3,221 total issues

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

        public async Task<bool> SiteUpdate(int siteMicrotingUid, string siteName, string userFirstName,
            string userLastName, string userEmail, string languageCode)
Severity: Minor
Found in eFormCore/Core.cs - About 45 mins to fix

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

            public Task<string> UnitRequestOtp(int microtingUid, int siteId, bool newOtp, bool pushEnabled,
                bool syncDelayEnabled, bool syncDialogEnabled)
    Severity: Minor
    Found in eFormCore/Communication/Communicator.cs - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                          case Constants.Notifications.RetrievedForm:
                                              _sqlController.NotificationCreate(notificationUId, microtingUId,
                                                  Constants.Notifications.RetrievedForm).GetAwaiter().GetResult();
                                              _bus.SendLocal(new EformRetrieved(notificationUId, microtingUId)).GetAwaiter()
                                                  .GetResult();
      Severity: Major
      Found in eFormCore/Services/Subscriber.cs - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                            case Constants.Notifications.UnitActivate:
                                                _sqlController.NotificationCreate(notificationUId, microtingUId,
                                                    Constants.Notifications.UnitActivate).GetAwaiter().GetResult();
                                                _bus.SendLocal(new UnitActivated(notificationUId, microtingUId)).GetAwaiter()
                                                    .GetResult();
        Severity: Major
        Found in eFormCore/Services/Subscriber.cs - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                              case Constants.Notifications.SpeechToTextCompleted:
                                                  _sqlController.NotificationCreate(notificationUId, microtingUId,
                                                      Constants.Notifications.SpeechToTextCompleted).GetAwaiter().GetResult();
                                                  _bus.SendLocal(new TranscriptionCompleted(notificationUId, microtingUId))
                                                      .GetAwaiter().GetResult();
          Severity: Major
          Found in eFormCore/Services/Subscriber.cs - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                                case Constants.Notifications.InSightAnswerDone:
                                                    _sqlController.NotificationCreate(notificationUId, microtingUId,
                                                        Constants.Notifications.InSightAnswerDone).GetAwaiter().GetResult();
                                                    _bus.SendLocal(new AnswerCompleted(notificationUId, microtingUId)).GetAwaiter()
                                                        .GetResult();
            Severity: Major
            Found in eFormCore/Services/Subscriber.cs - About 45 mins to fix

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

                      public async Task<string> UnitUpdate(int id, bool newOtp, int siteId, bool pushEnabled, bool syncDelayEnabled,
                          bool syncDialogEnabled)
              Severity: Minor
              Found in eFormCore/Communication/HttpFake.cs - About 45 mins to fix

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

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

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

                          public async Task<CheckList> CreateSubTemplate(string label, string description, string caseType,
                              int displayIndex, int repeated, CheckList parentId)
                  Severity: Minor
                  Found in eFormCore/Helpers/TestHelpers.cs - About 45 mins to fix

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

                            public async Task<string> UnitUpdate(int id, bool newOtp, int siteId, bool pushEnabled, bool syncDelayEnabled,
                                bool syncDialogEnabled)
                    Severity: Minor
                    Found in eFormCore/Communication/Http.cs - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                          case Constants.Notifications.EformParsingError:
                                                              _bus.SendLocal(new EformParsingError(notificationUId, microtingUId))
                                                                  .GetAwaiter().GetResult();
                                                              break;
                      Severity: Major
                      Found in eFormCore/Services/Subscriber.cs - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                    if (resp.Checks.Count > 0)
                                                    {
                                                        await SaveResult(resp, respXml, dbContext, microtingUid, null, aCase)
                                                            .ConfigureAwait(false);
                                                        noResults = false;
                        Severity: Major
                        Found in eFormCore/Handlers/EformCompletedHandler.cs - About 45 mins to fix

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

                                  private async Task<int> SaveResult(Response resp, string respXml, MicrotingDbContext dbContext,
                                      int microtingUid, int? checkIdLastKnown, CaseDto aCase)
                          Severity: Minor
                          Found in eFormCore/Handlers/EformCompletedHandler.cs - About 45 mins to fix

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

                                    Task<string> UnitUpdate(int id, bool newOtp, int siteId, bool pushEnabled, bool syncDelayEnabled,
                                        bool syncDialogEnabled);
                            Severity: Minor
                            Found in eFormCore/Communication/IHttp.cs - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                                  case Constants.Notifications.Completed:
                                                                      _sqlController.NotificationCreate(notificationUId, microtingUId,
                                                                          Constants.Notifications.Completed).GetAwaiter().GetResult();
                                                                      _bus.SendLocal(new EformCompleted(notificationUId, microtingUId)).GetAwaiter()
                                                                          .GetResult();
                              Severity: Major
                              Found in eFormCore/Services/Subscriber.cs - About 45 mins to fix

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

                                        private async Task CreateSpecialOption(MicrotingDbContext dbContext, int weight, int weightedValue, string text,
                                            int languageId, int optionIndex)
                                Severity: Minor
                                Found in eFormCore/Infrastructure/Data/Entities/Question.cs - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                                      case Constants.Notifications.EformParsedByServer:
                                                                          _bus.SendLocal(new EformParsedByServer(notificationUId, microtingUId))
                                                                              .GetAwaiter().GetResult();
                                                                          break;
                                  Severity: Major
                                  Found in eFormCore/Services/Subscriber.cs - About 45 mins to fix

                                    Method Close has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
                                    Open

                                            public async Task<bool> Close()
                                    #pragma warning restore 1998
                                            {
                                                string methodName = "Core.Close";
                                                Log.LogStandard(methodName, "Close called");
                                    Severity: Minor
                                    Found in eFormCore/Core.cs - 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 (hash != null)
                                                                        {
                                                                            //rename local file
                                                                            FileInfo fileInfo = new FileInfo(filePathAndFileName);
                                    
                                    
                                    Severity: Major
                                    Found in eFormCore/Core.cs - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                                                  if (value.Tag == ExifTag.Orientation)
                                                                                  {
                                                                                      if (unit.Manufacturer == "iOS")
                                                                                      {
                                                                                          Console.WriteLine($"rotate value is {value.GetValue()}");
                                      Severity: Major
                                      Found in eFormCore/Core.cs - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language