microting/eform-sdk-dotnet

View on GitHub

Showing 3,203 of 3,219 total issues

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

        public async Task<bool> CaseDeleteResult(int caseId)
        {
            string methodName = "SqlController.CaseDeleteResult";
            try
            {
Severity: Major
Found in eFormCore/Infrastructure/SqlController.cs and 3 other locations - About 1 hr to fix
eFormCore/Infrastructure/SqlController.cs on lines 4118..4141
eFormCore/Infrastructure/SqlController.cs on lines 4507..4538
eFormCore/Infrastructure/SqlController.cs on lines 4699..4720

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

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

    public class EntitySelect : DataItem
    {
        // con
        internal EntitySelect()
        {
Severity: Major
Found in eFormCore/Infrastructure/Models/DataItem.cs and 2 other locations - About 1 hr to fix
eFormCore/Infrastructure/Models/DataItem.cs on lines 108..137
eFormCore/Infrastructure/Models/DataItem.cs on lines 362..391

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

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

        public async Task<bool> SiteDelete(int microting_uid)
        {
            string methodName = "SqlController.SiteDelete";
            try
            {
Severity: Major
Found in eFormCore/Infrastructure/SqlController.cs and 3 other locations - About 1 hr to fix
eFormCore/Infrastructure/SqlController.cs on lines 1096..1117
eFormCore/Infrastructure/SqlController.cs on lines 4507..4538
eFormCore/Infrastructure/SqlController.cs on lines 4699..4720

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

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

    public class CheckBox : DataItem
    {
        internal CheckBox()
        {
        }
Severity: Major
Found in eFormCore/Infrastructure/Models/DataItem.cs and 2 other locations - About 1 hr to fix
eFormCore/Infrastructure/Models/DataItem.cs on lines 362..391
eFormCore/Infrastructure/Models/DataItem.cs on lines 624..656

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

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

        public async Task<bool> SiteWorkerDelete(int microting_uid)
        {
            string methodName = "SqlController.SiteWorkerDelete";
            try
            {
Severity: Major
Found in eFormCore/Infrastructure/SqlController.cs and 3 other locations - About 1 hr to fix
eFormCore/Infrastructure/SqlController.cs on lines 1096..1117
eFormCore/Infrastructure/SqlController.cs on lines 4118..4141
eFormCore/Infrastructure/SqlController.cs on lines 4699..4720

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

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

        public async Task<bool> UnitDelete(int microtingUid)
        {
            string methodName = "SqlController.UnitDelete";
            try
            {
Severity: Major
Found in eFormCore/Infrastructure/SqlController.cs and 3 other locations - About 1 hr to fix
eFormCore/Infrastructure/SqlController.cs on lines 1096..1117
eFormCore/Infrastructure/SqlController.cs on lines 4118..4141
eFormCore/Infrastructure/SqlController.cs on lines 4507..4538

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

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

    public class Picture : DataItem
    {
        internal Picture()
        {
        }
Severity: Major
Found in eFormCore/Infrastructure/Models/DataItem.cs and 2 other locations - About 1 hr to fix
eFormCore/Infrastructure/Models/DataItem.cs on lines 108..137
eFormCore/Infrastructure/Models/DataItem.cs on lines 624..656

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

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

                CheckList cl = new CheckList
                {
                    CreatedAt = DateTime.UtcNow,
                    UpdatedAt = DateTime.UtcNow,
                    // Label = groupElement.Label,
Severity: Major
Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 hr to fix
eFormCore/Infrastructure/SqlController.cs on lines 5967..5984

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

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

        public async Task<bool> UnitDelete(int unitId)
        {
            _log.LogEverything("Communicator.UnitDelete", "called");
            _log.LogVariable("Communicator.UnitDelete", nameof(unitId), unitId);

Severity: Major
Found in eFormCore/Communication/Communicator.cs and 1 other location - About 1 hr to fix
eFormCore/Communication/Communicator.cs on lines 312..326

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

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

        public async Task<bool> SiteDelete(int siteId)
        {
            _log.LogEverything("Communicator.SiteDelete", "called");
            _log.LogVariable("Communicator.SiteDelete", nameof(siteId), siteId);

Severity: Major
Found in eFormCore/Communication/Communicator.cs and 1 other location - About 1 hr to fix
eFormCore/Communication/Communicator.cs on lines 450..464

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

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

                CheckList cl = new CheckList
                {
                    CreatedAt = DateTime.UtcNow,
                    UpdatedAt = DateTime.UtcNow,
                    // Label = dataElement.Label,
Severity: Major
Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 hr to fix
eFormCore/Infrastructure/SqlController.cs on lines 5884..5899

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

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

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "CheckListTranslations");

Severity: Minor
Found in eFormCore/Migrations/20201225165255_FixingBrokenTableNames.cs - About 1 hr to fix

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

            protected override void Down(MigrationBuilder migrationBuilder)
            {
                migrationBuilder.DropForeignKey(
                    name: "FK_answer_values_options_OptionId",
                    table: "answer_values");

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

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

        Method GenerateSmileyOptions has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                private async Task GenerateSmileyOptions(MicrotingDbContext dbContext, int languageId)
                {
                    string[] smileys = { "" };
                    switch (QuestionType)
                    {
        Severity: Minor
        Found in eFormCore/Infrastructure/Data/Entities/Question.cs - About 1 hr to fix

          Method Languages_Update_DoesUpdate has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Method CaseToPdf has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    public async Task<string> CaseToPdf(int caseId, string jasperTemplate, string timeStamp,
                        string customPathForUploadedData, string fileType, string customXmlContent, Language language)
                    {
                        if (fileType != "pdf" && fileType != "docx" && fileType != "pptx")
                        {
            Severity: Minor
            Found in eFormCore/Core.cs - About 1 hr to fix

              Method FolderCreate has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public async Task<int> FolderCreate(List<KeyValuePair<string, string>> name,
                          List<KeyValuePair<string, string>> description, int? parentId)
                      {
                          string methodName = "Core.FolderCreate";
                          try
              Severity: Minor
              Found in eFormCore/Core.cs - About 1 hr to fix

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

                                    case Constants.Constants.FieldTypes.None:
                                        lstDataItem.Add(new None(_t.Int(field.Id), _t.Bool(field.Mandatory), _t.Bool(field.ReadOnly),
                                            fieldTranslation.Text, fieldTranslation.Description, field.Color,
                                            _t.Int(field.DisplayIndex), _t.Bool(field.Dummy)));
                                        break;
                Severity: Major
                Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 hr to fix
                eFormCore/Infrastructure/SqlController.cs on lines 7232..7236

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

                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.Signature:
                                        lstDataItem.Add(new Signature(_t.Int(field.Id), _t.Bool(field.Mandatory),
                                            _t.Bool(field.ReadOnly), fieldTranslation.Text, fieldTranslation.Description, field.Color,
                                            _t.Int(field.DisplayIndex), _t.Bool(field.Dummy)));
                                        break;
                Severity: Major
                Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 hr to fix
                eFormCore/Infrastructure/SqlController.cs on lines 7155..7159

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

                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