microting/eform-sdk-dotnet

View on GitHub

Showing 3,203 of 3,219 total issues

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

            modelBuilder.Entity("eFormSqlController.cases", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
eFormCore/Migrations/20190515064952_FixingNamingForFieldValues.Designer.cs on lines 277..349
eFormCore/Migrations/20190711053344_AddingJasperDocxEnabledAttributesToCheckList.Designer.cs on lines 277..349
eFormCore/Migrations/20190806093044_AddingSiteGroups.Designer.cs on lines 253..325
eFormCore/Migrations/20190828054730_AddingNewVersionClasses.Designer.cs on lines 277..349
eFormCore/Migrations/20190828074017_AddingMissingClasses.Designer.cs on lines 277..349

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

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

            modelBuilder.Entity("eFormSqlController.cases", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
eFormCore/Migrations/20190531092007_AddingMissingAIonLogs.Designer.cs on lines 277..349
eFormCore/Migrations/20190711053344_AddingJasperDocxEnabledAttributesToCheckList.Designer.cs on lines 277..349
eFormCore/Migrations/20190806093044_AddingSiteGroups.Designer.cs on lines 253..325
eFormCore/Migrations/20190828054730_AddingNewVersionClasses.Designer.cs on lines 277..349
eFormCore/Migrations/20190828074017_AddingMissingClasses.Designer.cs on lines 277..349

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

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

            modelBuilder.Entity("eFormSqlController.cases", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
eFormCore/Migrations/20190515064952_FixingNamingForFieldValues.Designer.cs on lines 277..349
eFormCore/Migrations/20190531092007_AddingMissingAIonLogs.Designer.cs on lines 277..349
eFormCore/Migrations/20190806093044_AddingSiteGroups.Designer.cs on lines 253..325
eFormCore/Migrations/20190828054730_AddingNewVersionClasses.Designer.cs on lines 277..349
eFormCore/Migrations/20190828074017_AddingMissingClasses.Designer.cs on lines 277..349

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

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

Class SqlControllerTestQuestion has 67 methods (exceeds 20 allowed). Consider refactoring.
Open

    [TestFixture]
    public class SqlControllerTestQuestion : DbTestFixture
    {
        #region create
        [Test]
Severity: Major
Found in eFormSDK.Integration.Tests/SqlControllerTestQuestion.cs - About 1 day to fix

    File DataItem.cs has 576 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    using System;
    using System.Collections.Generic;
    using System.Xml.Serialization;
    using Microting.eForm.Dto;
    using KeyValuePair = Microting.eForm.Dto.KeyValuePair;
    Severity: Major
    Found in eFormCore/Infrastructure/Models/DataItem.cs - About 1 day to fix

      Method Checklists_Update_DoesUpdate has 245 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              [Test]
              public async Task Checklists_Update_DoesUpdate()
              {
                  //Arrange
      
      
      Severity: Major
      Found in eFormSDK.CheckLists.Tests/CheckListsUTest.cs - About 1 day to fix

        Method SubChecks has 245 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                private async Task<Element> SubChecks(MicrotingDbContext db, int parentId, Case theCase, Language language)
                {
                    string methodName = "SqlController.SubChecks";
                    try
                    {
        Severity: Major
        Found in eFormCore/Infrastructure/SqlController.cs - About 1 day to fix

          File SqlControllerTestQuestionSet.cs has 572 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          using eFormCore;
          using Microsoft.EntityFrameworkCore;
          using NUnit.Framework;
          using System;
          using System.Collections.Generic;
          Severity: Major
          Found in eFormSDK.Integration.Tests/SqlControllerTestQuestionSet.cs - About 1 day to fix

            Method GenerateDataSetFromCases has a Cognitive Complexity of 76 (exceeds 20 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: Minor
            Found in eFormCore/Core.cs - About 1 day 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 FieldValues_Update_DoesUpdate has 239 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    [Test]
                    public async Task FieldValues_Update_DoesUpdate()
                    {
                        short shortMinValue = Int16.MinValue;
                        short shortmaxValue = Int16.MaxValue;
            Severity: Major
            Found in eFormSDK.CheckLists.Tests/FieldValuesUTest.cs - About 1 day to fix

              Method Core_Case_CaseUpdateFieldValues has 239 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      [Test]
                      public async Task Core_Case_CaseUpdateFieldValues()
                      {
                          // Arrance
              
              
              Severity: Major
              Found in eFormSDK.Integration.Case.CoreTests/CoreTestCase.cs - About 1 day to fix

                Method Core_Case_CaseUpdateFieldValues has 236 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        [Test]
                        public async Task Core_Case_CaseUpdateFieldValues()
                        {
                
                
                
                Severity: Major
                Found in eFormSDK.Integration.Tests/CoreTestCase.cs - About 1 day to fix

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

                              modelBuilder.Entity("eFormSqlController.case_versions", b =>
                                  {
                                      b.Property<int>("Id")
                                          .ValueGeneratedOnAdd()
                                          .HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
                  eFormCore/Migrations/20190515064952_FixingNamingForFieldValues.Designer.cs on lines 209..275
                  eFormCore/Migrations/20190531092007_AddingMissingAIonLogs.Designer.cs on lines 209..275
                  eFormCore/Migrations/20190806093044_AddingSiteGroups.Designer.cs on lines 185..251
                  eFormCore/Migrations/20190828054730_AddingNewVersionClasses.Designer.cs on lines 209..275
                  eFormCore/Migrations/20190828074017_AddingMissingClasses.Designer.cs on lines 209..275

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

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

                              modelBuilder.Entity("Microting.eForm.Infrastructure.Data.Entities.case_versions", b =>
                                  {
                                      b.Property<int>("Id")
                                          .ValueGeneratedOnAdd()
                                          .HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
                  eFormCore/Migrations/20190515064952_FixingNamingForFieldValues.Designer.cs on lines 209..275
                  eFormCore/Migrations/20190531092007_AddingMissingAIonLogs.Designer.cs on lines 209..275
                  eFormCore/Migrations/20190711053344_AddingJasperDocxEnabledAttributesToCheckList.Designer.cs on lines 209..275
                  eFormCore/Migrations/20190828054730_AddingNewVersionClasses.Designer.cs on lines 209..275
                  eFormCore/Migrations/20190828074017_AddingMissingClasses.Designer.cs on lines 209..275

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

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

                              modelBuilder.Entity("Microting.eForm.Infrastructure.Data.Entities.case_versions", b =>
                                  {
                                      b.Property<int>("Id")
                                          .ValueGeneratedOnAdd()
                                          .HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
                  eFormCore/Migrations/20190515064952_FixingNamingForFieldValues.Designer.cs on lines 209..275
                  eFormCore/Migrations/20190531092007_AddingMissingAIonLogs.Designer.cs on lines 209..275
                  eFormCore/Migrations/20190711053344_AddingJasperDocxEnabledAttributesToCheckList.Designer.cs on lines 209..275
                  eFormCore/Migrations/20190806093044_AddingSiteGroups.Designer.cs on lines 185..251
                  eFormCore/Migrations/20190828054730_AddingNewVersionClasses.Designer.cs on lines 209..275

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

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

                              modelBuilder.Entity("eFormSqlController.case_versions", b =>
                                  {
                                      b.Property<int>("Id")
                                          .ValueGeneratedOnAdd()
                                          .HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
                  eFormCore/Migrations/20190531092007_AddingMissingAIonLogs.Designer.cs on lines 209..275
                  eFormCore/Migrations/20190711053344_AddingJasperDocxEnabledAttributesToCheckList.Designer.cs on lines 209..275
                  eFormCore/Migrations/20190806093044_AddingSiteGroups.Designer.cs on lines 185..251
                  eFormCore/Migrations/20190828054730_AddingNewVersionClasses.Designer.cs on lines 209..275
                  eFormCore/Migrations/20190828074017_AddingMissingClasses.Designer.cs on lines 209..275

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

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

                              modelBuilder.Entity("Microting.eForm.Infrastructure.Data.Entities.case_versions", b =>
                                  {
                                      b.Property<int>("Id")
                                          .ValueGeneratedOnAdd()
                                          .HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
                  eFormCore/Migrations/20190515064952_FixingNamingForFieldValues.Designer.cs on lines 209..275
                  eFormCore/Migrations/20190531092007_AddingMissingAIonLogs.Designer.cs on lines 209..275
                  eFormCore/Migrations/20190711053344_AddingJasperDocxEnabledAttributesToCheckList.Designer.cs on lines 209..275
                  eFormCore/Migrations/20190806093044_AddingSiteGroups.Designer.cs on lines 185..251
                  eFormCore/Migrations/20190828074017_AddingMissingClasses.Designer.cs on lines 209..275

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

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

                              modelBuilder.Entity("eFormSqlController.case_versions", b =>
                                  {
                                      b.Property<int>("Id")
                                          .ValueGeneratedOnAdd()
                                          .HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
                  eFormCore/Migrations/20190515064952_FixingNamingForFieldValues.Designer.cs on lines 209..275
                  eFormCore/Migrations/20190711053344_AddingJasperDocxEnabledAttributesToCheckList.Designer.cs on lines 209..275
                  eFormCore/Migrations/20190806093044_AddingSiteGroups.Designer.cs on lines 185..251
                  eFormCore/Migrations/20190828054730_AddingNewVersionClasses.Designer.cs on lines 209..275
                  eFormCore/Migrations/20190828074017_AddingMissingClasses.Designer.cs on lines 209..275

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

                  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

                                      case Constants.Constants.FieldTypes.Number:
                                          Number number = (Number)dataItem;
                                          field.MinValue = number.MinValue;
                                          field.MaxValue = number.MaxValue;
                                          field.DefaultValue = number.DefaultValue.ToString();
                  Severity: Major
                  Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 day to fix
                  eFormCore/Infrastructure/SqlController.cs on lines 6286..6341

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

                  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

                                      case Constants.Constants.FieldTypes.NumberStepper:
                                          NumberStepper numberStepper = (NumberStepper)dataItem;
                                          field.MinValue = numberStepper.MinValue;
                                          field.MaxValue = numberStepper.MaxValue;
                                          field.DefaultValue = numberStepper.DefaultValue.ToString();
                  Severity: Major
                  Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 day to fix
                  eFormCore/Infrastructure/SqlController.cs on lines 6229..6284

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

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language