microting/eform-sdk-dotnet

View on GitHub

Showing 886 of 3,221 total issues

Method SQL_Check_CheckListValueStatusRead_ReturnsCheckListValuesStatus has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        [Test]
        public async Task SQL_Check_CheckListValueStatusRead_ReturnsCheckListValuesStatus()
        {
            // Arrance

    Method Down has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            protected override void Down(MigrationBuilder migrationBuilder)
            {
                migrationBuilder.DropForeignKey(
                    name: "FK_field_values_uploaded_datas_UploadedDataId",
                    table: "field_values");
    Severity: Minor
    Found in eFormCore/Migrations/20201220201427_FixingQuestionSet.cs - About 1 hr to fix

      Method surveyConfiguration_Update_DoesUpdate has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              [Test]
              public async Task surveyConfiguration_Update_DoesUpdate()
              {
                  // Arrange
                  Random rnd = new Random();
      Severity: Minor
      Found in eFormSDK.Integration.Tests/SqlControllerTestSurveyConfiguration.cs - About 1 hr to fix

        Method siteSurveyConfiguration_Create_DoesCreate has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                [Test]
                public async Task siteSurveyConfiguration_Create_DoesCreate()
                {
                    // Arrange
                    Random rnd = new Random();

          Method CaseUpdate has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public async Task<bool> CaseUpdate(int caseId, List<string> newFieldValuePairLst,
                      List<string> newCheckListValuePairLst)
                  {
                      string methodName = "Core.CaseUpdate";
                      try
          Severity: Minor
          Found in eFormCore/Core.cs - About 1 hr to fix

            Method EntityGroupCreate has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    public async Task<Microting.eForm.Infrastructure.Data.Entities.EntityGroup> EntityGroupCreate(string entityType,
                        string name, string description, bool locked, bool editable)
                    {
                        string methodName = "Core.EntityGroupCreate";
                        try
            Severity: Minor
            Found in eFormCore/Core.cs - About 1 hr to fix

              Method Advanced_SiteItemDelete has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public async Task<bool> Advanced_SiteItemDelete(int microtingUid)
                      {
                          string methodName = "Core.Advanced_SiteItemDelete";
                          try
                          {
              Severity: Minor
              Found in eFormCore/Core.cs - About 1 hr to fix

                Method Core_Template_TemplateUploAddAsyncata_ReturnsmainElement has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        [Test]
                        public async Task Core_Template_TemplateUploAddAsyncata_ReturnsmainElement()
                        {
                            // Arrange
                            CoreElement CElement = new CoreElement();
                Severity: Minor
                Found in eFormSDK.Integration.CheckLists.CoreTests/CoreTesteForm.cs - About 1 hr to fix

                  Method ClassToXml has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          public string ClassToXml()
                          {
                              try
                              {
                                  string xmlStr = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + Environment.NewLine +
                  Severity: Minor
                  Found in eFormCore/Infrastructure/Models/reply/Response.cs - About 1 hr to fix

                    Method CaseUpdateCompleted has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            public async Task CaseUpdateCompleted(int microtingUId, int microtingCheckId, DateTime doneAt,
                                int workerMicrotingUId, int unitMicrotingUid)
                            {
                                string methodName = "SqlController.CaseUpdateCompleted";
                                try
                    Severity: Minor
                    Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                      Method CreateSpecialOption has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              private async Task CreateSpecialOption(MicrotingDbContext dbContext, int weight, int weightedValue, string text,
                                  int languageId, int optionIndex)
                              {
                                  var result = (from ot in dbContext.OptionTranslations
                                      join o in dbContext.Options
                      Severity: Minor
                      Found in eFormCore/Infrastructure/Data/Entities/Question.cs - About 1 hr to fix

                        Method Delete has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                public async Task<string> Delete(string elementId, string siteId)
                                {
                                    try
                                    {if (_addressNewApi != "none")
                                        {
                        Severity: Minor
                        Found in eFormCore/Communication/Http.cs - About 1 hr to fix

                          Method SiteCreate has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  public async Task<Tuple<SiteDto, UnitDto>> SiteCreate(string name, string languageCode)
                                  {
                                      _log.LogEverything("Communicator.SiteCreate", "called");
                                      _log.LogVariable("Communicator.SiteCreate", nameof(name), name);
                          
                          
                          Severity: Minor
                          Found in eFormCore/Communication/Communicator.cs - About 1 hr to fix

                            Method Workers_Create_DoesCreate has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    [Test]
                                    public async Task Workers_Create_DoesCreate()
                                    {
                                        //Arrange
                                        Random rnd = new Random();
                            Severity: Minor
                            Found in eFormSDK.Base.Tests/WorkersUTest.cs - About 1 hr to fix

                              Method Tags_Delete_DoesSetWorkflowStateToRemoved has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      [Test]
                                      public async Task Tags_Delete_DoesSetWorkflowStateToRemoved()
                                      {
                                          Random rnd = new Random();
                              
                              
                              Severity: Minor
                              Found in eFormSDK.Base.Tests/TagsUTest.cs - About 1 hr to fix

                                Method TranscribeUploadedData has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        public async Task<bool> TranscribeUploadedData(int uploadedDataId)
                                        {
                                            string methodName = "Core.TranscribeUploadedData";
                                            try
                                            {
                                Severity: Minor
                                Found in eFormCore/Core.cs - About 1 hr to fix

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

                                          public async Task<CaseList> CaseReadAll(int? templatId, DateTime? start, DateTime? end, string workflowState,
                                              string searchKey, bool descendingSort, string sortParameter, int offSet, int pageSize,
                                              TimeZoneInfo timeZoneInfo)
                                  Severity: Major
                                  Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                    Method SettingCheckAll has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring.
                                    Open

                                            public async Task<List<string>> SettingCheckAll()
                                            {
                                                string methodName = "SqlController.SettingCheckAll";
                                                List<string> result = new List<string>();
                                                try
                                    Severity: Minor
                                    Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr 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

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

                                            public async Task<CaseList> CaseReadAll(int? templateId, DateTime? start, DateTime? end, string workflowState,
                                                string searchKey, bool descendingSort, string sortParameter, int pageIndex, int pageSize,
                                                TimeZoneInfo timeZoneInfo)
                                    Severity: Major
                                    Found in eFormCore/Core.cs - About 1 hr to fix

                                      Method CreateUploadedData has 10 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                              public async Task<UploadedData> CreateUploadedData(string checkSum, string currentFile, string extension,
                                                  string fileLocation, string fileName, short? local, Worker worker, string uploaderType, int version,
                                                  bool createPhysicalFile)
                                      Severity: Major
                                      Found in eFormCore/Helpers/TestHelpers.cs - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language