microting/eform-sdk-dotnet

View on GitHub

Showing 3,203 of 3,219 total issues

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

            Question question = new Question
            {
                Image = randomBool,
                Maximum = rnd.Next(1, 255),
                Minimum = rnd.Next(1, 255),
Severity: Major
Found in eFormSDK.InSight.Tests/OptionTranslationUTest.cs and 13 other locations - About 2 hrs to fix
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 58..75
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 146..163
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 241..258
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 261..278
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 410..427
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 535..552
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 555..572
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 684..701
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 704..721
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 822..839
eFormSDK.InSight.Tests/OptionsUTest.cs on lines 56..73
eFormSDK.InSight.Tests/OptionsUTest.cs on lines 134..151
eFormSDK.InSight.Tests/OptionsUTest.cs on lines 233..250

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

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

            Question question = new Question
            {
                Image = randomBool,
                Maximum = rnd.Next(1, 255),
                Minimum = rnd.Next(1, 255),
Severity: Major
Found in eFormSDK.InSight.Tests/OptionTranslationUTest.cs and 13 other locations - About 2 hrs to fix
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 146..163
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 241..258
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 261..278
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 390..407
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 410..427
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 535..552
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 555..572
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 684..701
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 704..721
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 822..839
eFormSDK.InSight.Tests/OptionsUTest.cs on lines 56..73
eFormSDK.InSight.Tests/OptionsUTest.cs on lines 134..151
eFormSDK.InSight.Tests/OptionsUTest.cs on lines 233..250

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

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

            Question question = new Question
            {
                Image = randomBool,
                Maximum = rnd.Next(1, 255),
                Minimum = rnd.Next(1, 255),
Severity: Major
Found in eFormSDK.InSight.Tests/OptionTranslationUTest.cs and 13 other locations - About 2 hrs to fix
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 58..75
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 146..163
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 241..258
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 261..278
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 390..407
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 410..427
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 535..552
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 555..572
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 684..701
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 704..721
eFormSDK.InSight.Tests/OptionsUTest.cs on lines 56..73
eFormSDK.InSight.Tests/OptionsUTest.cs on lines 134..151
eFormSDK.InSight.Tests/OptionsUTest.cs on lines 233..250

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

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

            Question question = new Question
            {
                Image = randomBool,
                Maximum = rnd.Next(1, 255),
                Minimum = rnd.Next(1, 255),
Severity: Major
Found in eFormSDK.InSight.Tests/OptionTranslationUTest.cs and 13 other locations - About 2 hrs to fix
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 58..75
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 241..258
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 261..278
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 390..407
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 410..427
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 535..552
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 555..572
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 684..701
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 704..721
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 822..839
eFormSDK.InSight.Tests/OptionsUTest.cs on lines 56..73
eFormSDK.InSight.Tests/OptionsUTest.cs on lines 134..151
eFormSDK.InSight.Tests/OptionsUTest.cs on lines 233..250

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

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

            Question question2 = new Question
            {
                Image = randomBool,
                Maximum = rnd.Next(1, 255),
                Minimum = rnd.Next(1, 255),
Severity: Major
Found in eFormSDK.InSight.Tests/OptionTranslationUTest.cs and 13 other locations - About 2 hrs to fix
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 58..75
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 146..163
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 241..258
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 390..407
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 410..427
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 535..552
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 555..572
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 684..701
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 704..721
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 822..839
eFormSDK.InSight.Tests/OptionsUTest.cs on lines 56..73
eFormSDK.InSight.Tests/OptionsUTest.cs on lines 134..151
eFormSDK.InSight.Tests/OptionsUTest.cs on lines 233..250

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

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

            Question question = new Question
            {
                Image = randomBool,
                Maximum = rnd.Next(1, 255),
                Minimum = rnd.Next(1, 255),
Severity: Major
Found in eFormSDK.InSight.Tests/OptionTranslationUTest.cs and 13 other locations - About 2 hrs to fix
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 58..75
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 146..163
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 261..278
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 390..407
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 410..427
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 535..552
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 555..572
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 684..701
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 704..721
eFormSDK.InSight.Tests/OptionTranslationUTest.cs on lines 822..839
eFormSDK.InSight.Tests/OptionsUTest.cs on lines 56..73
eFormSDK.InSight.Tests/OptionsUTest.cs on lines 134..151
eFormSDK.InSight.Tests/OptionsUTest.cs on lines 233..250

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

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

        [Test] // Core_Template_TemplateFromXml_ReturnsTemplate()
        public async Task Core_eForm_SimpleCommenteFormFromXML_ReturnseMainElement()
        {
            // Arrange
            string xmlstring = @"
Severity: Major
Found in eFormSDK.Integration.CheckLists.CoreTests/CoreTesteFormFromXML.cs - About 2 hrs to fix

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

            protected override void Up(MigrationBuilder migrationBuilder)
            {
                migrationBuilder.AlterColumn<int>(
                    name: "MicrotingUid",
                    table: "notifications",
    Severity: Major
    Found in eFormCore/Migrations/20190923100451_ChangeStringToInt.cs - About 2 hrs to fix

      Method EntityGroupAll has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public async Task<EntityGroupList> EntityGroupAll(string sort, string nameFilter, int offSet, int pageSize,
                  string entityType, bool desc, string workflowState)
              {
                  if (entityType != Constants.Constants.FieldTypes.EntitySearch &&
                      entityType != Constants.Constants.FieldTypes.EntitySelect)
      Severity: Major
      Found in eFormCore/Infrastructure/SqlController.cs - About 2 hrs to fix

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

                protected override void Down(MigrationBuilder migrationBuilder)
                {
                    migrationBuilder.DropTable(
                        name: "case_versions");
        
        
        Severity: Major
        Found in eFormCore/Migrations/20180810124416_InitialCreate.cs - About 2 hrs to fix

          Method XmlToClassUsingXmlDocument has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public Response XmlToClassUsingXmlDocument(string xmlStr)
                  {
                      try
                      {
                          ResponseTypes rType = ResponseTypes.Invalid;
          Severity: Major
          Found in eFormCore/Infrastructure/Models/reply/Response.cs - About 2 hrs to fix

            Method Core_eFormSimpleCheckBoxFormCreateInDB_ReturnseFormId has 71 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    [Test]
                    public async Task Core_eFormSimpleCheckBoxFormCreateInDB_ReturnseFormId()
                    {
                        string xmlstring = @"
                            <?xml version='1.0' encoding='UTF-8'?>
            Severity: Major
            Found in eFormSDK.Integration.CheckLists.CoreTests/CoreTesteFormCreateInDB.cs - About 2 hrs to fix

              Method Core_eForm_SimplePdfFormCreateInDB_ReturnseFormId has 71 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      [Test]
                      public async Task Core_eForm_SimplePdfFormCreateInDB_ReturnseFormId()
                      {
                          // Arrange
                          string xmlstring = @"
              Severity: Major
              Found in eFormSDK.Integration.CheckLists.CoreTests/CoreTesteFormCreateInDB.cs - About 2 hrs to fix

                Method SimpleSiteGetAll has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        public async Task<List<SiteDto>> SimpleSiteGetAll(string workflowState, int? offSet, int? limit)
                        {
                            List<SiteDto> siteList = new List<SiteDto>();
                            await using var db = GetContext();
                            List<Site> matches = null;
                Severity: Major
                Found in eFormCore/Infrastructure/SqlController.cs - About 2 hrs to fix

                  Method Options_Delete_DoesSetWorkflowStateToRemoved has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          [Test]
                          public async Task Options_Delete_DoesSetWorkflowStateToRemoved()
                          {
                              Random rnd = new Random();
                  
                  
                  Severity: Major
                  Found in eFormSDK.InSight.Tests/OptionsUTest.cs - About 2 hrs to fix

                    Class SqlControllerTestQuestionSet has 25 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                        [TestFixture]
                        public class SqlControllerTestQuestionSet : DbTestFixture
                        {
                            private SqlController sut;
                            private TestHelpers testHelpers;
                    Severity: Minor
                    Found in eFormSDK.Integration.Tests/SqlControllerTestQuestionSet.cs - About 2 hrs to fix

                      Method SQL_Site_SiteGetAll_DoesReturnAllSites has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              [Test]
                              public async Task SQL_Site_SiteGetAll_DoesReturnAllSites()
                              {
                                  // Arrance
                      
                      
                      Severity: Major
                      Found in eFormSDK.Integration.Base.SqlControllerTests/SqlControllerTestSite.cs - About 2 hrs to fix

                        Method Core_eFormSimpleNumberFormFromXML_ReturnseMainElement has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                [Test]
                                public async Task Core_eFormSimpleNumberFormFromXML_ReturnseMainElement()
                                {
                                    string xmlstring = @"
                                        <?xml version='1.0' encoding='UTF-8'?>
                        Severity: Major
                        Found in eFormSDK.Integration.CheckLists.CoreTests/CoreTesteFormFromXML.cs - About 2 hrs to fix

                          Method Core_eFormSimpleTimerFormCreateInDB_ReturnseFormId has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  [Test]
                                  public async Task Core_eFormSimpleTimerFormCreateInDB_ReturnseFormId()
                                  {
                                      string xmlstring = @"
                                          <?xml version='1.0' encoding='UTF-8'?>
                          Severity: Major
                          Found in eFormSDK.Integration.CheckLists.CoreTests/CoreTesteFormCreateInDB.cs - About 2 hrs to fix

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

                                    protected override void Up(MigrationBuilder migrationBuilder)
                                    {
                            //            migrationBuilder.DropForeignKey(
                            //                name: "FK_field_values_check_lists_check_list_id",
                            //                table: "field_values");
                            Severity: Major
                            Found in eFormCore/Migrations/20190515064952_FixingNamingForFieldValues.cs - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language