microting/eform-sdk-dotnet

View on GitHub

Showing 3,203 of 3,219 total issues

Method CreateCase has 16 arguments (exceeds 4 allowed). Consider refactoring.
Open

        public async Task<Case> CreateCase(string caseUId, CheckList checkList, DateTime created_at, string custom,
            DateTime done_at, Worker doneByUserId, int microtingCheckId, int microtingUId, Site site, int? status,
            string caseType, Unit unit, DateTime updated_at, int version, Worker worker, string WorkFlowState)
Severity: Major
Found in eFormCore/Helpers/TestHelpers.cs - About 2 hrs to fix

    Method SiteSurveyConfigurations_Create_DoesCreate has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            [Test]
            public async Task SiteSurveyConfigurations_Create_DoesCreate()
            {
                //Arrange
    
    
    Severity: Minor
    Found in eFormSDK.InSight.Tests/SiteSurveyConfigurationsUTest.cs - About 2 hrs to fix

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

      using Microsoft.EntityFrameworkCore.Migrations;
      
      namespace Microting.eForm.Migrations
      {
          public partial class FixingSplitScreen : Migration
      Severity: Major
      Found in eFormCore/Migrations/20201130204234_FixingSplitScreen.cs and 1 other location - About 2 hrs to fix
      eFormCore/Migrations/20200617160004_ChangingOptionsIndexToOptionIndex.cs on lines 1..34

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

      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

      using Microsoft.EntityFrameworkCore.Migrations;
      
      namespace Microting.eForm.Migrations
      {
          public partial class ChangingOptionsIndexToOptionIndex : Migration
      eFormCore/Migrations/20201130204234_FixingSplitScreen.cs on lines 1..34

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

      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

              {
                  string methodName = "SqlController.SiteWorkerUpdate";
                  try
                  {
                      await using var db = GetContext();
      Severity: Major
      Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 2 hrs to fix
      eFormCore/Infrastructure/SqlController.cs on lines 4666..4691

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

      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

              {
                  string methodName = "SqlController.UnitUpdate";
                  try
                  {
                      await using var db = GetContext();
      Severity: Major
      Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 2 hrs to fix
      eFormCore/Infrastructure/SqlController.cs on lines 4467..4499

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

      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<string> FolderDelete(int id)
              {
                  try
                  {
                      var url =
      Severity: Major
      Found in eFormCore/Communication/Http.cs and 1 other location - About 2 hrs to fix
      eFormCore/Communication/Http.cs on lines 748..762

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

      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<string> WorkerDelete(int id)
              {
                  try
                  {
                      var url =
      Severity: Major
      Found in eFormCore/Communication/Http.cs and 1 other location - About 2 hrs to fix
      eFormCore/Communication/Http.cs on lines 831..846

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

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

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

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

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

      Refactorings

      Further Reading

      Method SQL_answers_Create_DoesCreate_UTCAdjustedFalse has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              [Test]
              public async Task SQL_answers_Create_DoesCreate_UTCAdjustedFalse()
              {
                  // Arrange
                  Random rnd = new Random();
      Severity: Minor
      Found in eFormSDK.Integration.Tests/SqlControllerTestAnswer.cs - About 1 hr to fix

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

                protected override void Up(MigrationBuilder migrationBuilder)
                {
        
                    //Setup for SQL Server Provider
                   
        Severity: Minor
        Found in eFormCore/Migrations/20190828074017_AddingMissingClasses.cs - About 1 hr to fix

          Method CreateField has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public async Task<Field> CreateField(short? barcodeEnabled, string barcodeType, CheckList checkList,
                      string color, string custom, int? decimalCount, string defaultValue, string description, int? displayIndex,
                      short? dummy, FieldType ft, short? geolocationEnabled, short? geolocationForced, short? geolocationHidden,
                      short? isNum, string label, short? mandatory, int maxLength, string maxValue, string minValue, short? multi,
                      short? optional, string queryType, short? readOnly, short? selected, short? split, short? stopOnSave,
          Severity: Minor
          Found in eFormCore/Helpers/TestHelpers.cs - About 1 hr to fix

            Method ReplaceDataElementsAndDataItems has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    private async Task<List<Element>> ReplaceDataElementsAndDataItems(int caseId, List<Element> elementList,
                        List<FieldValue> lstAnswers)
                    {
                        List<Element> elementListReplaced = new List<Element>();
            
            
            Severity: Minor
            Found in eFormCore/Core.cs - About 1 hr to fix

              Method Folders_Delete_DoesSetWorkflowStateToRemoved has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                Method LanguageQuestionSet_Delete_DoesDelete has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

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

                          private ElementList XmlToClassCheck(string xmlStr)
                          {
                              try
                              {
                                  byte[] byteArray = Encoding.UTF8.GetBytes(xmlStr);
                  Severity: Major
                  Found in eFormCore/Infrastructure/Models/reply/Response.cs and 1 other location - About 1 hr to fix
                  eFormCore/Infrastructure/Models/MainElement.cs on lines 262..280

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

                  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 MainElement XmlToClass(string xmlStr)
                          {
                              try
                              {
                                  byte[] byteArray = Encoding.UTF8.GetBytes(xmlStr);
                  Severity: Major
                  Found in eFormCore/Infrastructure/Models/MainElement.cs and 1 other location - About 1 hr to fix
                  eFormCore/Infrastructure/Models/reply/Response.cs on lines 365..383

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

                  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.Timer:
                                          lstDataItem.Add(new Timer(_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),
                                              _t.Bool(field.StopOnSave)));
                  Severity: Major
                  Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 hr to fix
                  eFormCore/Infrastructure/SqlController.cs on lines 7126..7131

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

                  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.Audio:
                                          lstDataItem.Add(new Audio(_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),
                                              _t.Int(field.Multi)));
                  Severity: Major
                  Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 hr to fix
                  eFormCore/Infrastructure/SqlController.cs on lines 7275..7280

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

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

                          public Response JsonToClass(string json)
                          {
                              try
                              {
                                  string value = "";
                  Severity: Minor
                  Found in eFormCore/Infrastructure/Models/reply/Response.cs - About 1 hr to fix

                    Method SiteTags_Update_DoesUpdate has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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