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 class ShowPdf : DataItem
    {
        internal ShowPdf()
        {
        }
Severity: Major
Found in eFormCore/Infrastructure/Models/DataItem.cs and 3 other locations - About 1 hr to fix
eFormCore/Infrastructure/Models/DataItem.cs on lines 80..104
eFormCore/Infrastructure/Models/DataItem.cs on lines 423..447
eFormCore/Infrastructure/Models/DataItem.cs on lines 549..573

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

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 class SaveButton : DataItem
    {
        internal SaveButton()
        {
        }
Severity: Major
Found in eFormCore/Infrastructure/Models/DataItem.cs and 3 other locations - About 1 hr to fix
eFormCore/Infrastructure/Models/DataItem.cs on lines 80..104
eFormCore/Infrastructure/Models/DataItem.cs on lines 395..419
eFormCore/Infrastructure/Models/DataItem.cs on lines 549..573

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

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 class Audio : DataItem
    {
        internal Audio()
        {
        }
Severity: Major
Found in eFormCore/Infrastructure/Models/DataItem.cs and 3 other locations - About 1 hr to fix
eFormCore/Infrastructure/Models/DataItem.cs on lines 395..419
eFormCore/Infrastructure/Models/DataItem.cs on lines 423..447
eFormCore/Infrastructure/Models/DataItem.cs on lines 549..573

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

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 class Timer : DataItem
    {
        internal Timer()
        {
        }
Severity: Major
Found in eFormCore/Infrastructure/Models/DataItem.cs and 3 other locations - About 1 hr to fix
eFormCore/Infrastructure/Models/DataItem.cs on lines 80..104
eFormCore/Infrastructure/Models/DataItem.cs on lines 395..419
eFormCore/Infrastructure/Models/DataItem.cs on lines 423..447

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

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

        [Test]
        public async Task Core_SiteWorkers_Advanced_SiteWorkerDelete_MarksAsRemoved()
        {
            // Arrange

Severity: Minor
Found in eFormSDK.Integration.CheckLists.CoreTests/CoreTestAdvanced.cs - About 1 hr to fix

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

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

      Method CreateUploadedData has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public async Task<UploadedData> CreateUploadedData(string checkSum, string currentFile, string extension,
                  string fileLocation, string fileName, short? local, Worker worker, string uploaderType, int version,
                  bool createPhysicalFile)
              {
                  UploadedData UD = new UploadedData
      Severity: Minor
      Found in eFormCore/Helpers/TestHelpers.cs - About 1 hr to fix

        Method Advanced_TemplateDisplayIndexChangeServer has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public async Task<bool> Advanced_TemplateDisplayIndexChangeServer(int templateId, int siteUId,
                    int newDisplayIndex)
                {
                    string methodName = "Core.Advanced_TemplateDisplayIndexChangeServer";
                    try
        Severity: Minor
        Found in eFormCore/Core.cs - About 1 hr to fix

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

                      {
                          if (!Running()) throw new Exception("Core is not running");
                          Log.LogStandard(methodName, "called");
                          Log.LogVariable(methodName, nameof(microtingUId), microtingUId);
                          Log.LogVariable(methodName, nameof(checkUId), checkUId);
          Severity: Major
          Found in eFormCore/Core.cs and 1 other location - About 1 hr to fix
          eFormCore/Core.cs on lines 4352..4360

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

          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

                      {
                          if (!Running()) throw new Exception("Core is not running");
                          Log.LogStandard(methodName, "called");
                          Log.LogVariable(methodName, nameof(templateId), templateId);
                          Log.LogVariable(methodName, nameof(newDisplayIndex), newDisplayIndex);
          Severity: Major
          Found in eFormCore/Core.cs and 1 other location - About 1 hr to fix
          eFormCore/Core.cs on lines 1884..1891

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

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

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

            Method SQL_Check_CheckListValueStatusUpdate_UpdatesCheckListValues has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    [Test]
                    public async Task SQL_Check_CheckListValueStatusUpdate_UpdatesCheckListValues()
                    {
                        // Arrance
            
            

              Method SQL_Tags_GetAllTags_DoesReturnAllTags has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      [Test]
                      public async Task SQL_Tags_GetAllTags_DoesReturnAllTags()
                      {
                          // Arrance
                          string tagName1 = "Tag1";

                Method SQL_UploadedData_FileRead_DoesReturnOneUploadedData has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Method Core_UploadedData_UploadedDataRead_DoesReturnOneUploadedDataClass has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          [Test]
                          public async Task Core_UploadedData_UploadedDataRead_DoesReturnOneUploadedDataClass()
                          {
                              // Arrance
                              string checksum = "";
                  Severity: Minor
                  Found in eFormSDK.Integration.Base.CoreTests/CoreTestUploadedData.cs - About 1 hr to fix

                    Method siteSurveyConfiguration_Delete_DoesDelete has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            [Test]
                            public async Task siteSurveyConfiguration_Delete_DoesDelete()
                            {
                                // Arrange
                                Random rnd = new Random();

                      Method HttpDelete has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              private async Task<string> HttpDelete(string url, string contentType = null, bool addToken = false,
                                  bool followRedirect = false)
                              {
                                  try
                                  {
                      Severity: Minor
                      Found in eFormCore/Communication/Http.cs - About 1 hr to fix

                        Method HttpPost has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                private async Task<string> HttpPost(string url, StringContent content, string contentType = null,
                                    bool addToken = false, bool followRedirect = false)
                                {
                                    try
                                    {
                        Severity: Minor
                        Found in eFormCore/Communication/Http.cs - About 1 hr to fix

                          Method Core_Case_CaseIdLookUp_returnsId has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

                            Method PutFileToS3Storage has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    public async Task PutFileToS3Storage(Stream stream, string fileName)
                                    {
                                        string methodName = "Core.PutFileToS3Storage";
                                        string bucketName = await _sqlController.SettingRead(Settings.s3BucketName);
                                        Log.LogStandard(methodName, $"Trying to upload file {fileName} to {bucketName}");
                            Severity: Minor
                            Found in eFormCore/Core.cs - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language