microting/eform-sdk-dotnet

View on GitHub

Showing 3,203 of 3,219 total issues

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

        [Test]
        public async Task Core_Tags_CreateTag_DoesCreateNewTag()
        {
            // Arrance
            string tagName = "Tag1";
Severity: Major
Found in eFormSDK.Integration.Base.CoreTests/CoreTestTag.cs and 1 other location - About 1 hr to fix
eFormSDK.Integration.Base.SqlControllerTests/SqlControllerTestTag.cs on lines 73..87

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 123.

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 5 locations. Consider refactoring.
Open

            Microting.eForm.Infrastructure.Data.Entities.Case aCase = await testHelpers.CreateCase("caseUId", cl1,
                DateTime.UtcNow, "custom", DateTime.UtcNow,
                worker, rnd.Next(1, 255), rnd.Next(1, 255),
                site, 66, "caseType", unit, DateTime.UtcNow, 1, worker, Constants.WorkflowStates.Created);
eFormSDK.Integration.Case.SqlControllerTests/SqlControllerTestCase.cs on lines 477..480
eFormSDK.Integration.Case.SqlControllerTests/SqlControllerTestCase.cs on lines 1417..1420
eFormSDK.Integration.Case.SqlControllerTests/SqlControllerTestCase.cs on lines 1536..1539
eFormSDK.Integration.Case.SqlControllerTests/SqlControllerTestCase.cs on lines 1656..1659

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 123.

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 5 locations. Consider refactoring.
Open

            Microting.eForm.Infrastructure.Data.Entities.Case aCase = await testHelpers.CreateCase("caseUId", cl1,
                DateTime.UtcNow, "custom", DateTime.UtcNow,
                worker, rnd.Next(1, 255), rnd.Next(1, 255),
                site, 100, "caseType", unit, DateTime.UtcNow, 1, worker, Constants.WorkflowStates.Created);
eFormSDK.Integration.Case.SqlControllerTests/SqlControllerTestCase.cs on lines 1209..1212
eFormSDK.Integration.Case.SqlControllerTests/SqlControllerTestCase.cs on lines 1417..1420
eFormSDK.Integration.Case.SqlControllerTests/SqlControllerTestCase.cs on lines 1536..1539
eFormSDK.Integration.Case.SqlControllerTests/SqlControllerTestCase.cs on lines 1656..1659

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 123.

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 5 locations. Consider refactoring.
Open

            Microting.eForm.Infrastructure.Data.Entities.Case aCase = await testHelpers.CreateCase("caseUId", cl1,
                DateTime.UtcNow, "custom", DateTime.UtcNow,
                worker, rnd.Next(1, 255), rnd.Next(1, 255),
                site, 66, "caseType", unit, DateTime.UtcNow, 1, worker, Constants.WorkflowStates.Created);
eFormSDK.Integration.Case.SqlControllerTests/SqlControllerTestCase.cs on lines 477..480
eFormSDK.Integration.Case.SqlControllerTests/SqlControllerTestCase.cs on lines 1209..1212
eFormSDK.Integration.Case.SqlControllerTests/SqlControllerTestCase.cs on lines 1417..1420
eFormSDK.Integration.Case.SqlControllerTests/SqlControllerTestCase.cs on lines 1656..1659

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 123.

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 5 locations. Consider refactoring.
Open

            Microting.eForm.Infrastructure.Data.Entities.Case aCase = await testHelpers.CreateCase("caseUId", cl1,
                DateTime.UtcNow, "custom", DateTime.UtcNow,
                worker, rnd.Next(1, 255), rnd.Next(1, 255),
                site, 66, "caseType", unit, DateTime.UtcNow, 1, worker, Constants.WorkflowStates.Created);
eFormSDK.Integration.Case.SqlControllerTests/SqlControllerTestCase.cs on lines 477..480
eFormSDK.Integration.Case.SqlControllerTests/SqlControllerTestCase.cs on lines 1209..1212
eFormSDK.Integration.Case.SqlControllerTests/SqlControllerTestCase.cs on lines 1417..1420
eFormSDK.Integration.Case.SqlControllerTests/SqlControllerTestCase.cs on lines 1536..1539

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 123.

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

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

            EntityItem entityItem = new EntityItem
            {
                Description = Guid.NewGuid().ToString(),
                Name = Guid.NewGuid().ToString(),
                Synced = (short)rnd.Next(shortMinValue, shortmaxValue),
Severity: Major
Found in eFormSDK.CheckLists.Tests/EntityItemsUTest.cs and 2 other locations - About 1 hr to fix
eFormSDK.CheckLists.Tests/EntityItemsUTest.cs on lines 58..67
eFormSDK.CheckLists.Tests/EntityItemsUTest.cs on lines 129..138

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 122.

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

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

            EntityItem entityItem = new EntityItem
            {
                Description = Guid.NewGuid().ToString(),
                Name = Guid.NewGuid().ToString(),
                Synced = (short)rnd.Next(shortMinValue, shortmaxValue),
Severity: Major
Found in eFormSDK.CheckLists.Tests/EntityItemsUTest.cs and 2 other locations - About 1 hr to fix
eFormSDK.CheckLists.Tests/EntityItemsUTest.cs on lines 58..67
eFormSDK.CheckLists.Tests/EntityItemsUTest.cs on lines 230..239

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 122.

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

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

            EntityItem entityItem = new EntityItem
            {
                Description = Guid.NewGuid().ToString(),
                Name = Guid.NewGuid().ToString(),
                Synced = (short)rnd.Next(shortMinValue, shortmaxValue),
Severity: Major
Found in eFormSDK.CheckLists.Tests/EntityItemsUTest.cs and 2 other locations - About 1 hr to fix
eFormSDK.CheckLists.Tests/EntityItemsUTest.cs on lines 129..138
eFormSDK.CheckLists.Tests/EntityItemsUTest.cs on lines 230..239

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 122.

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 EntityGroups_Delete_DoesSetWorkflowStateToRemoved has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        [Test]
        public async Task EntityGroups_Delete_DoesSetWorkflowStateToRemoved()
        {
            EntityGroup entityGroup = new EntityGroup
            {
Severity: Minor
Found in eFormSDK.CheckLists.Tests/EntityGroupsUTest.cs - About 1 hr to fix

    Method SQL_UploadedData_UploadedDataRead_DoesReturnOneUploadedDataClass has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            [Test]
            public async Task SQL_UploadedData_UploadedDataRead_DoesReturnOneUploadedDataClass()
            {
                // Arrance
                string checksum = "";

      Method Core_Template_TemplateDelete_SetsWorkflowStateToRemoved has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Method Core_Site_SiteUpdate_returnsTrue has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                [Test] //Using Communicatorn needs httpMock
                public async Task Core_Site_SiteUpdate_returnsTrue()
                {
                    // Arrange
                    // Arrange
        Severity: Minor
        Found in eFormSDK.Integration.Base.CoreTests/CoreTestSite.cs - About 1 hr to fix

          Method Up has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  protected override void Up(MigrationBuilder migrationBuilder)
                  {
                      migrationBuilder.AddColumn<bool>(
                          name: "IsLocked",
                          table: "WorkerVersions",

            Method Up has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    protected override void Up(MigrationBuilder migrationBuilder)
                    {
                        migrationBuilder.AddColumn<bool>(
                            name: "IsEditable",
                            table: "CheckListVersions",
            Severity: Minor
            Found in eFormCore/Migrations/20211014105943_CLAttributes.cs - About 1 hr to fix

              Method ReadeForm has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public async Task<MainElement> ReadeForm(int templateId, Language language, bool includeDummyFields)
                      {
                          string methodName = "SqlController.TemplateRead";
                          try
                          {
              Severity: Minor
              Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                Method CaseReadByCaseId has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Method GenerateSpecialQuestionTypes has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          private async Task GenerateSpecialQuestionTypes(MicrotingDbContext dbContext, int languageId)
                          {
                              switch (QuestionType)
                              {
                                  case Constants.Constants.QuestionTypes.Number:
                  Severity: Minor
                  Found in eFormCore/Infrastructure/Data/Entities/Question.cs - About 1 hr to fix

                    Method LanguageQuestionSet_Create_DoesCreate_WO_MicrotingUid has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      Method GenerateDataSetFromCases has 12 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              public async Task<List<List<string>>> GenerateDataSetFromCases(int? checkListId, DateTime? start, DateTime? end,
                                  string customPathForUploadedData, string decimalSeparator, string thousandSeparator, bool utcTime,
                                  CultureInfo cultureInfo, TimeZoneInfo timeZoneInfo, Language language, bool includeCheckListText,
                                  bool gpsCoordinates)
                      Severity: Major
                      Found in eFormCore/Core.cs - About 1 hr to fix

                        Method Tags_Update_DoesUpdate has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

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