microting/eform-sdk-dotnet

View on GitHub

Showing 3,203 of 3,219 total issues

Method Advanced_TemplateUpdateFieldIdsForColumns has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

        public async Task<bool> Advanced_TemplateUpdateFieldIdsForColumns(int templateId, int? fieldId1, int? fieldId2,
            int? fieldId3, int? fieldId4, int? fieldId5, int? fieldId6, int? fieldId7, int? fieldId8, int? fieldId9,
            int? fieldId10)
Severity: Major
Found in eFormCore/Core.cs - About 1 hr to fix

    Method SQL_Case_CaseRetract_DoesCaseGetRetracted has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            [Test]
            public async Task SQL_Case_CaseRetract_DoesCaseGetRetracted()
            {
                // Arrance
                Random rnd = new Random();

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

              protected override void Down(MigrationBuilder migrationBuilder)
              {
                  migrationBuilder.DropTable(
                      name: "answer_value_versions");
      
      
      Severity: Minor
      Found in eFormCore/Migrations/20190315092242_AddingModelseForInsight.cs - About 1 hr to fix

        Method SiteReadSimple has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public async Task<SiteDto> SiteReadSimple(int microting_uid)
                {
                    string methodName = "SqlController.SiteReadSimple";
                    try
                    {
        Severity: Minor
        Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

          Method HttpPut has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  private async Task<string> HttpPut(string url, StringContent content, string contentType = null,
                      bool addToken = false, bool followRedirect = false)
                  {
                      try
                      {
          Severity: Minor
          Found in eFormCore/Communication/Http.cs - About 1 hr to fix

            Method QuestionSets_Create_DoesCreate has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    [Test]
                    public async Task QuestionSets_Create_DoesCreate()
                    {
                        //Arrange
            
            
            Severity: Minor
            Found in eFormSDK.InSight.Tests/QuestionSetsUTest.cs - About 1 hr to fix

              Method Languages_Delete_DoesSetWorkflowStateToRemoved has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      [Test]
                      public async Task Languages_Delete_DoesSetWorkflowStateToRemoved()
                      {
                          //Arrange
              
              
              Severity: Minor
              Found in eFormSDK.Base.Tests/LanguagesUTest.cs - About 1 hr to fix

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                        {
                                            fieldTranslation =
                                                await dbContext.FieldTranslations.FirstOrDefaultAsync(x =>
                                                    x.LanguageId == englishLanguage.Id && x.FieldId == field.Id);
                                            if (fieldTranslation != null)
                Severity: Major
                Found in eFormCore/Infrastructure/Data/Entities/Field.cs and 1 other location - About 1 hr to fix
                eFormCore/Infrastructure/Data/Entities/Field.cs on lines 263..277

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 111.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                        {
                                            fieldTranslation =
                                                await dbContext.FieldTranslations.FirstOrDefaultAsync(x =>
                                                    x.LanguageId == englishLanguage.Id && x.FieldId == field.Id);
                                            if (fieldTranslation != null)
                Severity: Major
                Found in eFormCore/Infrastructure/Data/Entities/Field.cs and 1 other location - About 1 hr to fix
                eFormCore/Infrastructure/Data/Entities/Field.cs on lines 247..261

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 111.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Consider simplifying this complex logical expression.
                Open

                                        if (fieldType.Type == "FieldGroup")
                                        {
                                            List<DataItem> dataItemSubList = new List<DataItem>();
                                            foreach (Field subDbField in await db.Fields.AsNoTracking()
                                                         .Where(x => x.WorkflowState != Constants.Constants.WorkflowStates.Removed)
                Severity: Critical
                Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                              {
                                  var url =
                                      $"{_addressApi}/gwt/inspection_app/searchable_item_groups/{entityGroupId}.json?token={_token}&protocol={ProtocolEntitySelect}&organization_id={_organizationId}&sdk_ver={_dllVersion}";
                                  var newUrl =
                                      await HttpDelete(url, "application/json").ConfigureAwait(false); // todo maybe not need content type
                  Severity: Major
                  Found in eFormCore/Communication/Http.cs and 1 other location - About 1 hr to fix
                  eFormCore/Communication/Http.cs on lines 593..600

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 110.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          {
                              var url =
                                  $"{_addressApi}/gwt/inspection_app/searchable_items/{entitySelectItemId}.json?token={_token}&protocol={ProtocolEntitySelect}&organization_id={_organizationId}&sdk_ver={_dllVersion}";
                              var newUrl =
                                  await HttpDelete(url, "application/json").ConfigureAwait(false); // todo maybe not need content type
                  Severity: Major
                  Found in eFormCore/Communication/Http.cs and 1 other location - About 1 hr to fix
                  eFormCore/Communication/Http.cs on lines 532..539

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 110.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                          [Test]
                          public async Task Core_Case_GetJasperPath_returnsPath()
                          {
                              // Arrange
                  
                  
                  Severity: Major
                  Found in eFormSDK.Integration.Case.CoreTests/CoreTestCase.cs and 2 other locations - About 1 hr to fix
                  eFormSDK.Integration.Case.CoreTests/CoreTestCase.cs on lines 2718..2734
                  eFormSDK.Integration.Case.CoreTests/CoreTestCase.cs on lines 2748..2764

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 110.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                          [Test]
                          public async Task Core_Case_GetPdfPath_returnsPath()
                          {
                              // Arrange
                  
                  
                  Severity: Major
                  Found in eFormSDK.Integration.Case.CoreTests/CoreTestCase.cs and 2 other locations - About 1 hr to fix
                  eFormSDK.Integration.Case.CoreTests/CoreTestCase.cs on lines 2688..2704
                  eFormSDK.Integration.Case.CoreTests/CoreTestCase.cs on lines 2718..2734

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 110.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                          [Test]
                          public async Task Core_Case_GetPicturePath_returnsPath()
                          {
                              // Arrange
                  
                  
                  Severity: Major
                  Found in eFormSDK.Integration.Case.CoreTests/CoreTestCase.cs and 2 other locations - About 1 hr to fix
                  eFormSDK.Integration.Case.CoreTests/CoreTestCase.cs on lines 2688..2704
                  eFormSDK.Integration.Case.CoreTests/CoreTestCase.cs on lines 2748..2764

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 110.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                                      if (!string.IsNullOrEmpty(field.Label))
                                      {
                                          FieldTranslation fieldTranslation = new FieldTranslation
                                          {
                                              Text = field.Label,
                  Severity: Major
                  Found in eFormCore/Infrastructure/Data/Entities/Field.cs and 1 other location - About 1 hr to fix
                  eFormCore/Infrastructure/Data/Entities/CheckList.cs on lines 148..161

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 110.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                                  if (!string.IsNullOrEmpty(checkList.Label))
                                  {
                                      CheckListTranslation checkListTranslation = new CheckListTranslation
                                      {
                                          Text = checkList.Label,
                  Severity: Major
                  Found in eFormCore/Infrastructure/Data/Entities/CheckList.cs and 1 other location - About 1 hr to fix
                  eFormCore/Infrastructure/Data/Entities/Field.cs on lines 142..155

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 110.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                          [Test]
                          public async Task SQL_Case_CaseUpdateRetrieved_DoesCaseGetUpdated()
                          {
                              // Arrance
                              Random rnd = new Random();

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

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

                      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
                      
                      
                        Severity
                        Category
                        Status
                        Source
                        Language