microting/eform-sdk-dotnet

View on GitHub
eFormCore/Infrastructure/SqlController.cs

Summary

Maintainability
F
3 mos
Test Coverage

File SqlController.cs has 6083 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
Severity: Major
Found in eFormCore/Infrastructure/SqlController.cs - About 2 wks to fix

    Method FieldValueReadAllValues has a Cognitive Complexity of 221 (exceeds 20 allowed). Consider refactoring.
    Open

            public async Task<List<List<KeyValuePair>>> FieldValueReadAllValues(int fieldId, List<int> caseIds,
                string customPathForUploadedData, string decimalSeparator, string thousandSeparator, Language language,
                bool gpsCoordinates)
            {
                string methodName = "SqlController.FieldValueReadAllValues";
    Severity: Minor
    Found in eFormCore/Infrastructure/SqlController.cs - About 4 days 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 CreateDataItem has 810 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            private async Task CreateDataItem(int? parentFieldId, int elementId, DataItem dataItem, Language language)
            {
                string methodName = "SqlController.CreateDataItem";
                try
                {
    Severity: Major
    Found in eFormCore/Infrastructure/SqlController.cs - About 4 days to fix

      Method ChecksCreate has a Cognitive Complexity of 161 (exceeds 20 allowed). Consider refactoring.
      Open

              public async Task<List<int>> ChecksCreate(Response response, string xmlString, int xmlIndex)
              {
                  string methodName = "SqlController.ChecksCreate";
                  List<int> uploadedDataIds = new List<int>();
                  try
      Severity: Minor
      Found in eFormCore/Infrastructure/SqlController.cs - About 2 days 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 ReadFieldValue has a Cognitive Complexity of 154 (exceeds 20 allowed). Consider refactoring.
      Open

              private async Task<Models.FieldValue> ReadFieldValue(MicrotingDbContext db, FieldValue reply, Field dbField, bool joinUploadedData,
                  Language language)
              {
                  string methodName = "SqlController.ReadFieldValue";
                  try
      Severity: Minor
      Found in eFormCore/Infrastructure/SqlController.cs - About 2 days 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

      Class SqlController has 131 methods (exceeds 20 allowed). Consider refactoring.
      Open

          public class SqlController : LogWriter
          {
              // var
      
              private Log _log;
      Severity: Major
      Found in eFormCore/Infrastructure/SqlController.cs - About 2 days to fix

        Method SubChecks has a Cognitive Complexity of 133 (exceeds 20 allowed). Consider refactoring.
        Open

                private async Task<Element> SubChecks(MicrotingDbContext db, int parentId, Case theCase, Language language)
                {
                    string methodName = "SqlController.SubChecks";
                    try
                    {
        Severity: Minor
        Found in eFormCore/Infrastructure/SqlController.cs - About 2 days 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 CaseReadAll has a Cognitive Complexity of 131 (exceeds 20 allowed). Consider refactoring.
        Open

                public async Task<CaseList> CaseReadAll(int? templatId, DateTime? start, DateTime? end, string workflowState,
                    string searchKey, bool descendingSort, string sortParameter, int offSet, int pageSize,
                    TimeZoneInfo timeZoneInfo)
                {
                    string methodName = "SqlController.CaseReadAll";
        Severity: Minor
        Found in eFormCore/Infrastructure/SqlController.cs - About 2 days 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 CreateDataItem has a Cognitive Complexity of 114 (exceeds 20 allowed). Consider refactoring.
        Open

                private async Task CreateDataItem(int? parentFieldId, int elementId, DataItem dataItem, Language language)
                {
                    string methodName = "SqlController.CreateDataItem";
                    try
                    {
        Severity: Minor
        Found in eFormCore/Infrastructure/SqlController.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 ChecksCreate has 276 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public async Task<List<int>> ChecksCreate(Response response, string xmlString, int xmlIndex)
                {
                    string methodName = "SqlController.ChecksCreate";
                    List<int> uploadedDataIds = new List<int>();
                    try
        Severity: Major
        Found in eFormCore/Infrastructure/SqlController.cs - About 1 day to fix

          Method CaseUpdateFieldValues has a Cognitive Complexity of 82 (exceeds 20 allowed). Consider refactoring.
          Open

                  public async Task<bool> CaseUpdateFieldValues(int caseId, Language language)
                  {
                      string methodName = "SqlController.CaseUpdateFieldValues";
                      try
                      {
          Severity: Minor
          Found in eFormCore/Infrastructure/SqlController.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 CaseReadAll has 256 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public async Task<CaseList> CaseReadAll(int? templatId, DateTime? start, DateTime? end, string workflowState,
                      string searchKey, bool descendingSort, string sortParameter, int offSet, int pageSize,
                      TimeZoneInfo timeZoneInfo)
                  {
                      string methodName = "SqlController.CaseReadAll";
          Severity: Major
          Found in eFormCore/Infrastructure/SqlController.cs - About 1 day to fix

            Method FieldValueReadAllValues has 253 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    public async Task<List<List<KeyValuePair>>> FieldValueReadAllValues(int fieldId, List<int> caseIds,
                        string customPathForUploadedData, string decimalSeparator, string thousandSeparator, Language language,
                        bool gpsCoordinates)
                    {
                        string methodName = "SqlController.FieldValueReadAllValues";
            Severity: Major
            Found in eFormCore/Infrastructure/SqlController.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

                Method ReadFieldValue has 230 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        private async Task<Models.FieldValue> ReadFieldValue(MicrotingDbContext db, FieldValue reply, Field dbField, bool joinUploadedData,
                            Language language)
                        {
                            string methodName = "SqlController.ReadFieldValue";
                            try
                Severity: Major
                Found in eFormCore/Infrastructure/SqlController.cs - About 1 day to fix

                  Method SettingCreate has 219 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          public async Task<bool> SettingCreate(Settings name)
                          {
                              await using var db = GetContext();
                              //key point
                              // Id = settings.name
                  Severity: Major
                  Found in eFormCore/Infrastructure/SqlController.cs - About 1 day to fix

                    Consider simplifying this complex logical expression.
                    Open

                                        if (searchKey.Contains("!"))
                                        {
                                            searchKey = searchKey.ToLower().Replace("!", "");
                                            IQueryable<Case> excludeQuery = db.Cases.AsNoTracking().Where(x =>
                                                x.DoneAtUserModifiable > start && x.DoneAtUserModifiable < end);
                    Severity: Critical
                    Found in eFormCore/Infrastructure/SqlController.cs - About 1 day to fix

                      Method GetDataItem has 212 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              private async Task GetDataItem(List<DataItem> lstDataItem, List<DataItemGroup> lstDataItemGroup, Field field,
                                  Language language, bool includeDummyFields)
                              {
                                  string methodName = "SqlController.GetDataItem";
                                  try
                      Severity: Major
                      Found in eFormCore/Infrastructure/SqlController.cs - About 1 day to fix

                        Method TemplateItemRead has 208 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                public async Task<Template_Dto> TemplateItemRead(int templateId, Language language)
                                {
                                    string methodName = "SqlController.TemplateItemRead";
                        
                                    try
                        Severity: Major
                        Found in eFormCore/Infrastructure/SqlController.cs - About 1 day to fix

                          Method TemplateItemReadAll has 197 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  public async Task<List<Template_Dto>> TemplateItemReadAll(bool includeRemoved, string siteWorkflowState,
                                      string searchKey, bool descendingSort, string sortParameter, List<int> tagIds, TimeZoneInfo timeZoneInfo,
                                      Language language)
                                  {
                                      string methodName = "SqlController.TemplateItemReadAll";
                          Severity: Major
                          Found in eFormCore/Infrastructure/SqlController.cs - About 7 hrs to fix

                            Method CaseUpdateFieldValues has 143 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    public async Task<bool> CaseUpdateFieldValues(int caseId, Language language)
                                    {
                                        string methodName = "SqlController.CaseUpdateFieldValues";
                                        try
                                        {
                            Severity: Major
                            Found in eFormCore/Infrastructure/SqlController.cs - About 5 hrs to fix

                              Method TemplateItemReadAll has a Cognitive Complexity of 51 (exceeds 20 allowed). Consider refactoring.
                              Open

                                      public async Task<List<Template_Dto>> TemplateItemReadAll(bool includeRemoved, string siteWorkflowState,
                                          string searchKey, bool descendingSort, string sortParameter, List<int> tagIds, TimeZoneInfo timeZoneInfo,
                                          Language language)
                                      {
                                          string methodName = "SqlController.TemplateItemReadAll";
                              Severity: Minor
                              Found in eFormCore/Infrastructure/SqlController.cs - About 5 hrs 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 GetElement has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      private async Task<Element> GetElement(int elementId, Language language, bool includeDummyFields)
                                      {
                                          string methodName = "SqlController.GetElement";
                                          try
                                          {
                              Severity: Major
                              Found in eFormCore/Infrastructure/SqlController.cs - About 3 hrs to fix

                                Method TemplateSetTags has a Cognitive Complexity of 37 (exceeds 20 allowed). Consider refactoring.
                                Open

                                        public async Task<bool> TemplateSetTags(int templateId, List<int> tagIds)
                                        {
                                            string methodName = "SqlController.TemplateSetTags";
                                            try
                                            {
                                Severity: Minor
                                Found in eFormCore/Infrastructure/SqlController.cs - About 3 hrs 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 CreateDataElement has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        private async Task CreateDataElement(int parentId, DataElement dataElement, Language language)
                                        {
                                            string methodName = "SqlController.CreateDataElement";
                                            try
                                            {
                                Severity: Major
                                Found in eFormCore/Infrastructure/SqlController.cs - About 3 hrs to fix

                                  Method CreateGroupElement has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          private async Task CreateGroupElement(int parentId, GroupElement groupElement, Language language)
                                          {
                                              string methodName = "SqlController.CreateGroupElement";
                                              try
                                              {
                                  Severity: Major
                                  Found in eFormCore/Infrastructure/SqlController.cs - About 3 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 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 EformCreateDb has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                private async Task<int> EformCreateDb(MainElement mainElement)
                                                {
                                                    string methodName = "SqlController.EformCreateDb";
                                                    try
                                                    {
                                        Severity: Major
                                        Found in eFormCore/Infrastructure/SqlController.cs - About 2 hrs to fix

                                          Method SettingCheckAll has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                                  public async Task<List<string>> SettingCheckAll()
                                                  {
                                                      string methodName = "SqlController.SettingCheckAll";
                                                      List<string> result = new List<string>();
                                                      try
                                          Severity: Major
                                          Found in eFormCore/Infrastructure/SqlController.cs - About 2 hrs to fix

                                            Method TemplateItemRead has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring.
                                            Open

                                                    public async Task<Template_Dto> TemplateItemRead(int templateId, Language language)
                                                    {
                                                        string methodName = "SqlController.TemplateItemRead";
                                            
                                                        try
                                            Severity: Minor
                                            Found in eFormCore/Infrastructure/SqlController.cs - About 2 hrs 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 DbFieldToField has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                    private async Task<Models.Field> DbFieldToField(MicrotingDbContext db, Field dbField, Language language)
                                                    {
                                                        //await using var db = GetContext();
                                                        Models.Field field = new Models.Field
                                                        {
                                            Severity: Major
                                            Found in eFormCore/Infrastructure/SqlController.cs - About 2 hrs to fix

                                              Method CheckRead has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                      public async Task<ReplyElement> CheckRead(int id, Language language)
                                                      {
                                                          string methodName = "SqlController.CheckRead";
                                                          try
                                                          {
                                              Severity: Major
                                              Found in eFormCore/Infrastructure/SqlController.cs - About 2 hrs to fix

                                                Method CaseCreate has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                        public async Task<int> CaseCreate(int checkListId, int siteUId, int? microtingUId, int? microtingCheckId,
                                                            string caseUId, string custom, DateTime createdAt, int? folderId)
                                                        {
                                                            string methodName = "SqlController.CaseCreate";
                                                            _log.LogStandard(methodName, "called");
                                                Severity: Major
                                                Found in eFormCore/Infrastructure/SqlController.cs - About 2 hrs to fix

                                                  Method CheckRead has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                          public async Task<ReplyElement> CheckRead(int microtingUId, int checkUId, Language language)
                                                          {
                                                              string methodName = "SqlController.CheckRead";
                                                              try
                                                              {
                                                  Severity: Major
                                                  Found in eFormCore/Infrastructure/SqlController.cs - About 2 hrs to fix

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

                                                            public async Task<bool> TemplateSetTags(int templateId, List<int> tagIds)
                                                            {
                                                                string methodName = "SqlController.TemplateSetTags";
                                                                try
                                                                {
                                                    Severity: Minor
                                                    Found in eFormCore/Infrastructure/SqlController.cs - About 2 hrs to fix

                                                      Method GetElement has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring.
                                                      Open

                                                              private async Task<Element> GetElement(int elementId, Language language, bool includeDummyFields)
                                                              {
                                                                  string methodName = "SqlController.GetElement";
                                                                  try
                                                                  {
                                                      Severity: Minor
                                                      Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr 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 WorkerGetAll has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                              public async Task<List<WorkerDto>> WorkerGetAll(string workflowState, int? offSet, int? limit)
                                                              {
                                                                  string methodName = "SqlController.WorkerGetAll";
                                                                  try
                                                                  {
                                                      Severity: Minor
                                                      Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                        Method CaseReadByMUId has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                                public async Task<CaseDto> CaseReadByMUId(int microtingUId)
                                                                {
                                                                    string methodName = "SqlController.CaseReadByMUId";
                                                                    try
                                                                    {
                                                        Severity: Minor
                                                        Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                          Method CaseReadFirstId has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                                  public async Task<int?> CaseReadFirstId(int? templateId, string workflowState)
                                                                  {
                                                                      string methodName = "SqlController.CaseReadFirstId";
                                                                      _log.LogStandard(methodName, "called");
                                                                      _log.LogVariable(methodName, nameof(templateId), templateId);
                                                          Severity: Minor
                                                          Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                            Method SettingCreateDefaults has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                                            Open

                                                                    public async Task<bool> SettingCreateDefaults()
                                                                    {
                                                                        string methodName = "SqlController.SettingCreateDefaults";
                                                            
                                                                        WriteDebugConsoleLogEntry(new LogEntry(2, methodName, "called"));
                                                            Severity: Minor
                                                            Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                              Method TemplateFieldReadAll has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                                              Open

                                                                      public async Task<List<FieldDto>> TemplateFieldReadAll(int templateId, Language language)
                                                                      {
                                                                          string methodName = "SqlController.TemplateFieldReadAll";
                                                                          _log.LogEverything(methodName, "Start");
                                                                          try
                                                              Severity: Minor
                                                              Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                                Method ReadeForm has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                Open

                                                                        public async Task<MainElement> ReadeForm(int templateId, Language language, bool includeDummyFields)
                                                                        {
                                                                            string methodName = "SqlController.TemplateRead";
                                                                            try
                                                                            {
                                                                Severity: Minor
                                                                Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                                  Method CaseReadByCaseId has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                  Open

                                                                          public async Task<CaseDto> CaseReadByCaseId(int caseId)
                                                                          {
                                                                              string methodName = "SqlController.CaseReadByCaseId";
                                                                              try
                                                                              {
                                                                  Severity: Minor
                                                                  Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                                    Method TemplateUpdateFieldIdsForColumns has 11 arguments (exceeds 4 allowed). Consider refactoring.
                                                                    Open

                                                                            public async Task<bool> TemplateUpdateFieldIdsForColumns(int templateId, int? fieldId1, int? fieldId2,
                                                                                int? fieldId3, int? fieldId4, int? fieldId5, int? fieldId6, int? fieldId7, int? fieldId8, int? fieldId9,
                                                                                int? fieldId10)
                                                                    Severity: Major
                                                                    Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                                      Method SiteReadSimple has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                      Open

                                                                              public async Task<SiteDto> SiteReadSimple(int microting_uid)
                                                                              {
                                                                                  string methodName = "SqlController.SiteReadSimple";
                                                                                  try
                                                                                  {
                                                                      Severity: Minor
                                                                      Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                                        Consider simplifying this complex logical expression.
                                                                        Open

                                                                                                if (fieldType.Type == "FieldGroup")
                                                                                                {
                                                                                                    List<DataItem> dataItemSubList = new List<DataItem>();
                                                                                                    foreach (Field subDbField in await db.Fields.AsNoTracking()
                                                                                                                 .Where(x => x.WorkflowState != Constants.Constants.WorkflowStates.Removed)
                                                                        Severity: Critical
                                                                        Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                                          Method CaseUpdateCompleted has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                          Open

                                                                                  public async Task CaseUpdateCompleted(int microtingUId, int microtingCheckId, DateTime doneAt,
                                                                                      int workerMicrotingUId, int unitMicrotingUid)
                                                                                  {
                                                                                      string methodName = "SqlController.CaseUpdateCompleted";
                                                                                      try
                                                                          Severity: Minor
                                                                          Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                                            Method SettingCheckAll has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring.
                                                                            Open

                                                                                    public async Task<List<string>> SettingCheckAll()
                                                                                    {
                                                                                        string methodName = "SqlController.SettingCheckAll";
                                                                                        List<string> result = new List<string>();
                                                                                        try
                                                                            Severity: Minor
                                                                            Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr 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 CaseReadAll has 10 arguments (exceeds 4 allowed). Consider refactoring.
                                                                            Open

                                                                                    public async Task<CaseList> CaseReadAll(int? templatId, DateTime? start, DateTime? end, string workflowState,
                                                                                        string searchKey, bool descendingSort, string sortParameter, int offSet, int pageSize,
                                                                                        TimeZoneInfo timeZoneInfo)
                                                                            Severity: Major
                                                                            Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                                              Method FileCaseFindMUId has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                              Open

                                                                                      public async Task<CaseDto> FileCaseFindMUId(string urlString)
                                                                                      {
                                                                                          string methodName = "SqlController.FileCaseFindMUId";
                                                                                          try
                                                                                          {
                                                                              Severity: Minor
                                                                              Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                                                Method SiteWorkerRead has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                Open

                                                                                        public async Task<SiteWorkerDto> SiteWorkerRead(int? siteWorkerMicrotingUid, int? siteId, int? workerId)
                                                                                        {
                                                                                            string methodName = "SqlController.SiteWorkerRead";
                                                                                            try
                                                                                            {
                                                                                Severity: Minor
                                                                                Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                                                  Method EntityGroupCreate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                  Open

                                                                                          public async Task<EntityGroup> EntityGroupCreate(string name, string entityType, string description)
                                                                                          {
                                                                                              string methodName = "SqlController.EntityGroupCreate";
                                                                                              try
                                                                                              {
                                                                                  Severity: Minor
                                                                                  Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                                                    Method FileRead has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                    Open

                                                                                            public async Task<UploadedData> FileRead()
                                                                                            {
                                                                                                string methodName = "SqlController.FileRead";
                                                                                                try
                                                                                                {
                                                                                    Severity: Minor
                                                                                    Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                                                      Method FieldValueRead has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                      Open

                                                                                              public async Task<Models.FieldValue> FieldValueRead(FieldValue reply, bool joinUploadedData, Language language)
                                                                                              {
                                                                                                  string methodName = "SqlController.FieldValueRead";
                                                                                      
                                                                                                  try
                                                                                      Severity: Minor
                                                                                      Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                                                        Method EntityGroupDelete has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                        Open

                                                                                                public async Task<string> EntityGroupDelete(string entityGroupMUId)
                                                                                                {
                                                                                                    string methodName = "SqlController.EntityGroupDelete";
                                                                                                    try
                                                                                                    {
                                                                                        Severity: Minor
                                                                                        Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                                                          Method CheckRead has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
                                                                                          Open

                                                                                                  public async Task<ReplyElement> CheckRead(int id, Language language)
                                                                                                  {
                                                                                                      string methodName = "SqlController.CheckRead";
                                                                                                      try
                                                                                                      {
                                                                                          Severity: Minor
                                                                                          Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr 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 CaseReadFull has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                          Open

                                                                                                  public async Task<Case> CaseReadFull(int microtingUId, int checkUId)
                                                                                                  {
                                                                                                      string methodName = "SqlController.CaseReadFull";
                                                                                                      try
                                                                                                      {
                                                                                          Severity: Minor
                                                                                          Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                                                            Method UnitGetAll has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                            Open

                                                                                                    public async Task<List<UnitDto>> UnitGetAll()
                                                                                                    {
                                                                                                        string methodName = "SqlController.UnitGetAll";
                                                                                                        try
                                                                                                        {
                                                                                            Severity: Minor
                                                                                            Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                                                              Method CaseReadAll has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                              Open

                                                                                                      public async Task<List<Dto.Case>> CaseReadAll(int? templatId, DateTime? start, DateTime? end,
                                                                                                          string workflowState, string searchKey, bool descendingSort, string sortParameter,
                                                                                                          TimeZoneInfo timeZoneInfo)
                                                                                              Severity: Major
                                                                                              Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                                                                Method TemplateItemReadAll has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                Open

                                                                                                        public async Task<List<Template_Dto>> TemplateItemReadAll(bool includeRemoved, string siteWorkflowState,
                                                                                                            string searchKey, bool descendingSort, string sortParameter, List<int> tagIds, TimeZoneInfo timeZoneInfo,
                                                                                                            Language language)
                                                                                                Severity: Major
                                                                                                Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                                                                  Method CaseCreate has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                  Open

                                                                                                          public async Task<int> CaseCreate(int checkListId, int siteUId, int? microtingUId, int? microtingCheckId,
                                                                                                              string caseUId, string custom, DateTime createdAt, int? folderId)
                                                                                                  Severity: Major
                                                                                                  Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                                                                                    Method CheckRead has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring.
                                                                                                    Open

                                                                                                            public async Task<ReplyElement> CheckRead(int microtingUId, int checkUId, Language language)
                                                                                                            {
                                                                                                                string methodName = "SqlController.CheckRead";
                                                                                                                try
                                                                                                                {
                                                                                                    Severity: Minor
                                                                                                    Found in eFormCore/Infrastructure/SqlController.cs - About 55 mins 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 EntityGroupAll has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                    Open

                                                                                                            public async Task<EntityGroupList> EntityGroupAll(string sort, string nameFilter, int offSet, int pageSize,
                                                                                                                string entityType, bool desc, string workflowState)
                                                                                                    Severity: Major
                                                                                                    Found in eFormCore/Infrastructure/SqlController.cs - About 50 mins to fix

                                                                                                      Method FieldValueReadAllValues has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                      Open

                                                                                                              public async Task<List<List<KeyValuePair>>> FieldValueReadAllValues(int fieldId, List<int> caseIds,
                                                                                                                  string customPathForUploadedData, string decimalSeparator, string thousandSeparator, Language language,
                                                                                                                  bool gpsCoordinates)
                                                                                                      Severity: Major
                                                                                                      Found in eFormCore/Infrastructure/SqlController.cs - About 50 mins to fix

                                                                                                        Avoid deeply nested control flow statements.
                                                                                                        Open

                                                                                                                                        if (fieldType.Type == Constants.Constants.FieldTypes.Number ||
                                                                                                                                            fieldType.Type == Constants.Constants.FieldTypes.NumberStepper)
                                                                                                                                        {
                                                                                                        //                                        extractedValue = extractedValue.Replace(",", "|"); // commented as of 8. oct. 2019
                                                                                                                                            extractedValue = extractedValue.Replace(".", ",");
                                                                                                        Severity: Major
                                                                                                        Found in eFormCore/Infrastructure/SqlController.cs - About 45 mins to fix

                                                                                                          Avoid deeply nested control flow statements.
                                                                                                          Open

                                                                                                                                          if (!string.IsNullOrEmpty(extractedValue) && extractedValue != "null")
                                                                                                                                          {
                                                                                                                                              if (extractedValue.ToLower() == "true")
                                                                                                                                              {
                                                                                                                                                  fieldV.Value = "checked";
                                                                                                          Severity: Major
                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs - About 45 mins to fix

                                                                                                            Avoid deeply nested control flow statements.
                                                                                                            Open

                                                                                                                                            if (fieldV.FieldId == foo.Id)
                                                                                                                                            {
                                                                                                                                                eFormFieldList.RemoveAt(index);
                                                                                                                                                break;
                                                                                                                                            }
                                                                                                            Severity: Major
                                                                                                            Found in eFormCore/Infrastructure/SqlController.cs - About 45 mins to fix

                                                                                                              Avoid deeply nested control flow statements.
                                                                                                              Open

                                                                                                                                              if (newValue != "")
                                                                                                                                              {
                                                                                                                                                  newValue += "\n" + value;
                                                                                                                                              }
                                                                                                                                              else
                                                                                                              Severity: Major
                                                                                                              Found in eFormCore/Infrastructure/SqlController.cs - About 45 mins to fix

                                                                                                                Avoid deeply nested control flow statements.
                                                                                                                Open

                                                                                                                                                if (dU == null)
                                                                                                                                                {
                                                                                                                                                    dU = new Data.Entities.UploadedData
                                                                                                                                                    {
                                                                                                                                                        Extension = dataItemReply.Extension,
                                                                                                                Severity: Major
                                                                                                                Found in eFormCore/Infrastructure/SqlController.cs - About 45 mins to fix

                                                                                                                  Avoid deeply nested control flow statements.
                                                                                                                  Open

                                                                                                                                                      if (fieldValue.ValueReadable != "")
                                                                                                                                                      {
                                                                                                                                                          fieldValue.ValueReadable += '|';
                                                                                                                                                      }
                                                                                                                  Severity: Major
                                                                                                                  Found in eFormCore/Infrastructure/SqlController.cs - About 45 mins to fix

                                                                                                                    Avoid deeply nested control flow statements.
                                                                                                                    Open

                                                                                                                                                    if (!string.IsNullOrEmpty(extractedValue) && extractedValue != "null")
                                                                                                                                                    {
                                                                                                                                                        int id = EntityItemRead(extractedValue).GetAwaiter().GetResult().Id;
                                                                                                                                                        fieldV.Value = id.ToString();
                                                                                                                                                    }
                                                                                                                    Severity: Major
                                                                                                                    Found in eFormCore/Infrastructure/SqlController.cs - About 45 mins to fix

                                                                                                                      Avoid deeply nested control flow statements.
                                                                                                                      Open

                                                                                                                                                      if (uploadedData != null)
                                                                                                                                                      {
                                                                                                                                                          if (uploadedData.FileName != null)
                                                                                                                                                              locations += uploadedData.FileLocation + uploadedData.FileName +
                                                                                                                                                                           Environment.NewLine;
                                                                                                                      Severity: Major
                                                                                                                      Found in eFormCore/Infrastructure/SqlController.cs - About 45 mins to fix

                                                                                                                        Avoid deeply nested control flow statements.
                                                                                                                        Open

                                                                                                                                                            if (dbFieldValue == null)
                                                                                                                                                            {
                                                                                                                                                                FieldValue fieldValue = new FieldValue
                                                                                                                                                                {
                                                                                                                                                                    FieldId = subDbField.Id,
                                                                                                                        Severity: Major
                                                                                                                        Found in eFormCore/Infrastructure/SqlController.cs - About 45 mins to fix

                                                                                                                          Avoid deeply nested control flow statements.
                                                                                                                          Open

                                                                                                                                                              if (kvp.Key == item.CaseId.ToString())
                                                                                                                                                              {
                                                                                                                                                                  if (item.UploadedDataId.HasValue)
                                                                                                                                                                  {
                                                                                                                                                                      Data.Entities.UploadedData uploadedData =
                                                                                                                          Severity: Major
                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs - About 45 mins to fix

                                                                                                                            Consider simplifying this complex logical expression.
                                                                                                                            Open

                                                                                                                                            if (await db.CheckLists.AnyAsync(x => x.ParentId == checkList.Id))
                                                                                                                                            {
                                                                                                                                                List<Element> elementList = new List<Element>();
                                                                                                                                                foreach (CheckList subList in await db.CheckLists.AsNoTracking()
                                                                                                                                                             .Where(x => x.WorkflowState != Constants.Constants.WorkflowStates.Removed)
                                                                                                                            Severity: Major
                                                                                                                            Found in eFormCore/Infrastructure/SqlController.cs - About 40 mins to fix

                                                                                                                              Method CaseUpdateCompleted has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                              Open

                                                                                                                                      public async Task CaseUpdateCompleted(int microtingUId, int microtingCheckId, DateTime doneAt,
                                                                                                                                          int workerMicrotingUId, int unitMicrotingUid)
                                                                                                                              Severity: Minor
                                                                                                                              Found in eFormCore/Infrastructure/SqlController.cs - About 35 mins to fix

                                                                                                                                Method FieldValueReadAllValues has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                Open

                                                                                                                                        public async Task<List<List<KeyValuePair>>> FieldValueReadAllValues(int fieldId, List<int> caseIds,
                                                                                                                                            string customPathForUploadedData, Language language, bool gpsCoordinates)
                                                                                                                                Severity: Minor
                                                                                                                                Found in eFormCore/Infrastructure/SqlController.cs - About 35 mins to fix

                                                                                                                                  Method ReadFieldValue has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                  Open

                                                                                                                                          private async Task<Models.FieldValue> ReadFieldValue(MicrotingDbContext db, FieldValue reply, Field dbField, bool joinUploadedData,
                                                                                                                                              Language language)
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in eFormCore/Infrastructure/SqlController.cs - About 35 mins to fix

                                                                                                                                    Method NotificationUpdate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                    Open

                                                                                                                                            public async Task NotificationUpdate(string notificationUId, int microtingUId, string workflowState,
                                                                                                                                                string exception, string stacktrace)
                                                                                                                                    Severity: Minor
                                                                                                                                    Found in eFormCore/Infrastructure/SqlController.cs - About 35 mins to fix

                                                                                                                                      Method GetDataItem has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                      Open

                                                                                                                                              private async Task GetDataItem(List<DataItem> lstDataItem, List<DataItemGroup> lstDataItemGroup, Field field,
                                                                                                                                                  Language language, bool includeDummyFields)
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in eFormCore/Infrastructure/SqlController.cs - About 35 mins to fix

                                                                                                                                        Method FileProcessed has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                        Open

                                                                                                                                                public async Task FileProcessed(string urlString, string checkSum, string fileLocation, string fileName, int Id)
                                                                                                                                        Severity: Minor
                                                                                                                                        Found in eFormCore/Infrastructure/SqlController.cs - About 35 mins to fix

                                                                                                                                          Method EntityGroupAll has a Cognitive Complexity of 22 (exceeds 20 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: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs - About 35 mins 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

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

                                                                                                                                                              case Constants.Constants.FieldTypes.MultiSelect:
                                                                                                                                                                  MultiSelect multiSelect = (MultiSelect)dataItem;
                                                                                                                                                                  await field.Create(db).ConfigureAwait(false);
                                                                                                                                                                  fieldTranslation = new FieldTranslation
                                                                                                                                                                  {
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 day to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 6559..6650

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

                                                                                                                                          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.SingleSelect:
                                                                                                                                                                  SingleSelect singleSelect = (SingleSelect)dataItem;
                                                                                                                                                                  await field.Create(db).ConfigureAwait(false);
                                                                                                                                                                  fieldTranslation = new FieldTranslation
                                                                                                                                                                  {
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 day to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 6343..6434

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

                                                                                                                                          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.ShowPdf:
                                                                                                                                                                  ShowPdf showPdf = (ShowPdf)dataItem;
                                                                                                                                                                  await field.Create(db).ConfigureAwait(false);
                                                                                                                                                                  // field.DefaultValue = showPdf.Value;
                                                                                                                                                                  fieldTranslation = new FieldTranslation
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 day to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 6442..6497

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

                                                                                                                                          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.SaveButton:
                                                                                                                                                                  SaveButton saveButton = (SaveButton)dataItem;
                                                                                                                                                                  // field.DefaultValue = saveButton.Value;
                                                                                                                                                                  await field.Create(db).ConfigureAwait(false);
                                                                                                                                                                  fieldTranslation = new FieldTranslation
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 day to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 6499..6554

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

                                                                                                                                          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

                                                                                                                                          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

                                                                                                                                                                  excludeQuery = excludeQuery.Where(x => x.FieldValue1.ToLower().Contains(searchKey) ||
                                                                                                                                                                                                         x.FieldValue2.ToLower().Contains(searchKey) ||
                                                                                                                                                                                                         x.FieldValue3.ToLower().Contains(searchKey) ||
                                                                                                                                                                                                         x.FieldValue4.ToLower().Contains(searchKey) ||
                                                                                                                                                                                                         x.FieldValue5.ToLower().Contains(searchKey) ||
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 5 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3415..3429

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

                                                                                                                                          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

                                                                                                                                                                  subQuery = subQuery.Where(x => x.FieldValue1.ToLower().Contains(searchKey) ||
                                                                                                                                                                                                 x.FieldValue2.ToLower().Contains(searchKey) ||
                                                                                                                                                                                                 x.FieldValue3.ToLower().Contains(searchKey) ||
                                                                                                                                                                                                 x.FieldValue4.ToLower().Contains(searchKey) ||
                                                                                                                                                                                                 x.FieldValue5.ToLower().Contains(searchKey) ||
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 5 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3394..3408

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

                                                                                                                                          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.MultiSelect:
                                                                                                                                                                  var multiSelectFieldOptions =
                                                                                                                                                                      await db.FieldOptions.Where(x => x.FieldId == field.Id)
                                                                                                                                                                          .Where(x => x.WorkflowState != Constants.Constants.WorkflowStates.Removed)
                                                                                                                                                                          .Join(db.FieldOptionTranslations,
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 5 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 7238..7264

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

                                                                                                                                          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.SingleSelect:
                                                                                                                                                                  var singleSelectFieldOptions =
                                                                                                                                                                      await db.FieldOptions.Where(x => x.FieldId == field.Id)
                                                                                                                                                                          .Where(x => x.WorkflowState != Constants.Constants.WorkflowStates.Removed)
                                                                                                                                                                          .Join(db.FieldOptionTranslations,
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 5 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 7183..7209

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

                                                                                                                                          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

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

                                                                                                                                                          switch (workflowState)
                                                                                                                                                          {
                                                                                                                                                              case Constants.Constants.WorkflowStates.NotRetracted:
                                                                                                                                                                  subQuery = subQuery.Where(x => x.WorkflowState != Constants.Constants.WorkflowStates.Retracted);
                                                                                                                                                                  break;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 3 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3308..3325

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

                                                                                                                                          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

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

                                                                                                                                                          switch (workflowState)
                                                                                                                                                          {
                                                                                                                                                              case Constants.Constants.WorkflowStates.NotRetracted:
                                                                                                                                                                  subQuery = subQuery.Where(x => x.WorkflowState != Constants.Constants.WorkflowStates.Retracted);
                                                                                                                                                                  break;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 3 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3362..3379

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

                                                                                                                                          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 (dataItem.Label.Split("|").Length > 2)
                                                                                                                                                                  {
                                                                                                                                                                      fieldTranslation = new FieldTranslation
                                                                                                                                                                      {
                                                                                                                                                                          LanguageId = deLanguage.Id,
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 3 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 6185..6202

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

                                                                                                                                          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 (dataItem.Label.Split("|").Length > 1)
                                                                                                                                                                  {
                                                                                                                                                                      fieldTranslation = new FieldTranslation
                                                                                                                                                                      {
                                                                                                                                                                          LanguageId = ukLanguage.Id,
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 3 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 6204..6221

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

                                                                                                                                          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 (!db.FieldValues.Any(x =>
                                                                                                                                                                              x.FieldId == dbField.Id
                                                                                                                                                                              && x.CaseId == theCase.Id
                                                                                                                                                                              && x.WorkflowState != Constants.Constants.WorkflowStates.Removed))
                                                                                                                                                                      {
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 1687..1710

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

                                                                                                                                          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 (!db.FieldValues.Any(x =>
                                                                                                                                                                                  x.FieldId == subDbField.Id
                                                                                                                                                                                  && x.CaseId == theCase.Id
                                                                                                                                                                                  && x.WorkflowState != Constants.Constants.WorkflowStates.Removed))
                                                                                                                                                                          {
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 1757..1780

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

                                                                                                                                          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 (field.FieldType == "SingleSelect")
                                                                                                                                                      {
                                                                                                                                                          var singleSelectFieldOptions =
                                                                                                                                                              await db.FieldOptions.AsNoTracking().Where(x => x.FieldId == field.Id)
                                                                                                                                                                  .Join(db.FieldOptionTranslations,
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 1958..1980

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

                                                                                                                                          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 (field.FieldType == "MultiSelect")
                                                                                                                                                      {
                                                                                                                                                          var multiSelectFieldOptions =
                                                                                                                                                              await db.FieldOptions.AsNoTracking().Where(x => x.FieldId == field.Id)
                                                                                                                                                                  .Join(db.FieldOptionTranslations,
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 1934..1956

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

                                                                                                                                          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 (dataItemReply.GetType() == typeof(Microting.eForm.Infrastructure.Models.reply.Audio))
                                                                                                                                                                  {
                                                                                                                                                                      fieldType = "audio";
                                                                                                                                                                      Data.Entities.UploadedData dU =
                                                                                                                                                                          await db.UploadedDatas.FirstOrDefaultAsync(x => x.FileLocation == dataItemReply.URL);
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 1381..1401

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

                                                                                                                                          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 (dataItemReply.GetType() == typeof(Microting.eForm.Infrastructure.Models.reply.Picture))
                                                                                                                                                                  {
                                                                                                                                                                      fieldType = "picture";
                                                                                                                                                                      Data.Entities.UploadedData dU =
                                                                                                                                                                          await db.UploadedDatas.FirstOrDefaultAsync(x => x.FileLocation == dataItemReply.URL);
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 1359..1379

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

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

                                                                                                                                                          if (f6 != null)
                                                                                                                                                          {
                                                                                                                                                              FieldTranslation translation = await db.FieldTranslations
                                                                                                                                                                                                 .FirstOrDefaultAsync(x =>
                                                                                                                                                                                                     x.FieldId == f6.Id && x.LanguageId == language.Id) ??
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 8 other locations - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 252..261
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 264..273
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 276..285
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 288..297
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 312..321
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 324..333
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 336..345
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 348..357

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

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

                                                                                                                                                          if (f4 != null)
                                                                                                                                                          {
                                                                                                                                                              FieldTranslation translation = await db.FieldTranslations
                                                                                                                                                                                                 .FirstOrDefaultAsync(x =>
                                                                                                                                                                                                     x.FieldId == f4.Id && x.LanguageId == language.Id) ??
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 8 other locations - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 252..261
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 264..273
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 288..297
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 300..309
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 312..321
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 324..333
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 336..345
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 348..357

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

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

                                                                                                                                                          if (f10 != null)
                                                                                                                                                          {
                                                                                                                                                              FieldTranslation translation = await db.FieldTranslations
                                                                                                                                                                                                 .FirstOrDefaultAsync(x =>
                                                                                                                                                                                                     x.FieldId == f10.Id && x.LanguageId == language.Id) ??
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 8 other locations - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 252..261
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 264..273
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 276..285
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 288..297
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 300..309
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 312..321
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 324..333
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 336..345

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

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

                                                                                                                                                          if (f5 != null)
                                                                                                                                                          {
                                                                                                                                                              FieldTranslation translation = await db.FieldTranslations
                                                                                                                                                                                                 .FirstOrDefaultAsync(x =>
                                                                                                                                                                                                     x.FieldId == f5.Id && x.LanguageId == language.Id) ??
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 8 other locations - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 252..261
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 264..273
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 276..285
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 300..309
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 312..321
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 324..333
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 336..345
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 348..357

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

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

                                                                                                                                                          if (f8 != null)
                                                                                                                                                          {
                                                                                                                                                              FieldTranslation translation = await db.FieldTranslations
                                                                                                                                                                                                 .FirstOrDefaultAsync(x =>
                                                                                                                                                                                                     x.FieldId == f8.Id && x.LanguageId == language.Id) ??
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 8 other locations - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 252..261
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 264..273
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 276..285
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 288..297
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 300..309
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 312..321
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 336..345
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 348..357

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

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

                                                                                                                                                          if (f2 != null)
                                                                                                                                                          {
                                                                                                                                                              FieldTranslation translation = await db.FieldTranslations
                                                                                                                                                                                                 .FirstOrDefaultAsync(x =>
                                                                                                                                                                                                     x.FieldId == f2.Id && x.LanguageId == language.Id) ??
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 8 other locations - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 264..273
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 276..285
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 288..297
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 300..309
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 312..321
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 324..333
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 336..345
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 348..357

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

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

                                                                                                                                                          if (f9 != null)
                                                                                                                                                          {
                                                                                                                                                              FieldTranslation translation = await db.FieldTranslations
                                                                                                                                                                                                 .FirstOrDefaultAsync(x =>
                                                                                                                                                                                                     x.FieldId == f9.Id && x.LanguageId == language.Id) ??
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 8 other locations - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 252..261
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 264..273
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 276..285
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 288..297
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 300..309
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 312..321
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 324..333
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 348..357

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

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

                                                                                                                                                          if (f3 != null)
                                                                                                                                                          {
                                                                                                                                                              FieldTranslation translation = await db.FieldTranslations
                                                                                                                                                                                                 .FirstOrDefaultAsync(x =>
                                                                                                                                                                                                     x.FieldId == f3.Id && x.LanguageId == language.Id) ??
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 8 other locations - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 252..261
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 276..285
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 288..297
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 300..309
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 312..321
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 324..333
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 336..345
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 348..357

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

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

                                                                                                                                                          if (f7 != null)
                                                                                                                                                          {
                                                                                                                                                              FieldTranslation translation = await db.FieldTranslations
                                                                                                                                                                                                 .FirstOrDefaultAsync(x =>
                                                                                                                                                                                                     x.FieldId == f7.Id && x.LanguageId == language.Id) ??
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 8 other locations - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 252..261
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 264..273
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 276..285
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 288..297
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 300..309
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 324..333
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 336..345
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 348..357

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

                                                                                                                                          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 (groupElement.Label.Split("|").Length > 1)
                                                                                                                                                          {
                                                                                                                                                              checkListTranslation = new CheckListTranslation
                                                                                                                                                              {
                                                                                                                                                                  CheckListId = cl.Id,
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 5934..5950

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

                                                                                                                                          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 (groupElement.Label.Split("|").Length > 2)
                                                                                                                                                          {
                                                                                                                                                              checkListTranslation = new CheckListTranslation
                                                                                                                                                              {
                                                                                                                                                                  CheckListId = cl.Id,
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 5916..5932

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

                                                                                                                                          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

                                                                                                                                                                  var multiSelectFieldOptions =
                                                                                                                                                                      await db.FieldOptions.Where(x => x.FieldId == matchField.Id)
                                                                                                                                                                          .Join(db.FieldOptionTranslations,
                                                                                                                                                                              option => option.Id,
                                                                                                                                                                              translation => translation.FieldOptionId,
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 2537..2555

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

                                                                                                                                          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

                                                                                                                                                                  var singleSelectFieldOptions =
                                                                                                                                                                      await db.FieldOptions.Where(x => x.FieldId == matchField.Id)
                                                                                                                                                                          .Join(db.FieldOptionTranslations,
                                                                                                                                                                              option => option.Id,
                                                                                                                                                                              translation => translation.FieldOptionId,
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 2566..2584

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

                                                                                                                                          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.Picture:
                                                                                                                                                                  lstDataItem.Add(new Picture(_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), _t.Bool(field.GeolocationEnabled)));
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 7133..7138

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

                                                                                                                                          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.CheckBox:
                                                                                                                                                                  lstDataItem.Add(new CheckBox(_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(fieldTranslation.DefaultValue), _t.Bool(field.Selected)));
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 7211..7216

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

                                                                                                                                          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> EntityGroupUpdate(int entityGroupId, string entityGroupMUId)
                                                                                                                                                  {
                                                                                                                                                      string methodName = "SqlController.EntityGroupUpdate";
                                                                                                                                                      try
                                                                                                                                                      {
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 4928..4949

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

                                                                                                                                          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> EntityGroupUpdateName(string name, string entityGroupMUId)
                                                                                                                                                  {
                                                                                                                                                      string methodName = "SqlController.EntityGroupUpdateName";
                                                                                                                                                      try
                                                                                                                                                      {
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 4899..4919

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

                                                                                                                                          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 (dataElement.Label.Split("|").Length > 2)
                                                                                                                                                          {
                                                                                                                                                              checkListTranslation = new CheckListTranslation
                                                                                                                                                              {
                                                                                                                                                                  CheckListId = cl.Id,
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 6003..6017

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

                                                                                                                                          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 (dataElement.Label.Split("|").Length > 1)
                                                                                                                                                          {
                                                                                                                                                              checkListTranslation = new CheckListTranslation
                                                                                                                                                              {
                                                                                                                                                                  CheckListId = cl.Id,
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 2 hrs to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 6019..6033

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

                                                                                                                                          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

                                                                                                                                                  {
                                                                                                                                                      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

                                                                                                                                                              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

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

                                                                                                                                                              case Constants.Constants.FieldTypes.SaveButton:
                                                                                                                                                                  lstDataItem.Add(new SaveButton(_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),
                                                                                                                                                                      fieldTranslation.DefaultValue));
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 hr to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 7225..7230

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

                                                                                                                                          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.ShowPdf:
                                                                                                                                                                  lstDataItem.Add(new ShowPdf(_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),
                                                                                                                                                                      fieldTranslation.DefaultValue));
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 hr to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 7218..7223

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

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

                                                                                                                                          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

                                                                                                                                                              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

                                                                                                                                          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

                                                                                                                                                  public async Task<Data.Entities.UploadedData> GetUploaded_DataByTranscriptionId(int transcriptionId)
                                                                                                                                                  {
                                                                                                                                                      string methodName = "SqlController.GetUploaded_DataByTranscriptionId";
                                                                                                                                                      try
                                                                                                                                                      {
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 hr to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 2948..2960

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

                                                                                                                                          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<Data.Entities.UploadedData> GetUploadedData(int Id)
                                                                                                                                                  {
                                                                                                                                                      string methodName = "SqlController.GetUploadedData";
                                                                                                                                                      try
                                                                                                                                                      {
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 hr to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3008..3020

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

                                                                                                                                          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

                                                                                                                                                                  fieldTranslation = new FieldTranslation
                                                                                                                                                                  {
                                                                                                                                                                      LanguageId = language.Id,
                                                                                                                                                                      Text = dataItem.Label.Split("|")[0],
                                                                                                                                                                      Description = dataItem.Description != null
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 hr to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 6905..6915

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

                                                                                                                                          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

                                                                                                                                                              fieldTranslation = new FieldTranslation
                                                                                                                                                              {
                                                                                                                                                                  LanguageId = language.Id,
                                                                                                                                                                  Text = dataItem.Label.Split("|")[0],
                                                                                                                                                                  Description = dataItem.Description != null
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 hr to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 6840..6850

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

                                                                                                                                          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 (mainElement.Label.Split("|").Length > 1)
                                                                                                                                                          {
                                                                                                                                                              checkListTranslation = new CheckListTranslation
                                                                                                                                                              {
                                                                                                                                                                  CheckListId = cl.Id,
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 hr to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 5831..5840

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

                                                                                                                                          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 (mainElement.Label.Split("|").Length > 2)
                                                                                                                                                          {
                                                                                                                                                              checkListTranslation = new CheckListTranslation
                                                                                                                                                              {
                                                                                                                                                                  CheckListId = cl.Id,
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 hr to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 5820..5829

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

                                                                                                                                          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

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

                                                                                                                                                                          {
                                                                                                                                                                              string value = "";
                                                                                                                                                                              if (item.Value != null)
                                                                                                                                                                              {
                                                                                                                                                                                  value = item.Value.Replace(".", decimalSeparator)
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 hr to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 2663..2672

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

                                                                                                                                          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

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

                                                                                                                                                                          {
                                                                                                                                                                              string value = "";
                                                                                                                                                                              if (item.Value != null)
                                                                                                                                                                              {
                                                                                                                                                                                  value = item.Value.Replace(".", decimalSeparator)
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 hr to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 2674..2683

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

                                                                                                                                          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

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

                                                                                                                                                          if (checkListTranslation == null)
                                                                                                                                                          {
                                                                                                                                                              language = await db.Languages.AsNoTracking().FirstAsync(x => x.LanguageCode == "da");
                                                                                                                                                              checkListTranslation =
                                                                                                                                                                  await db.CheckListTranslations.AsNoTracking().FirstOrDefaultAsync(x =>
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 hr to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 1499..1505

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

                                                                                                                                          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

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

                                                                                                                                                          if (checkListTranslation == null)
                                                                                                                                                          {
                                                                                                                                                              language = await db.Languages.AsNoTracking().FirstAsync(x => x.LanguageCode == "da");
                                                                                                                                                              checkListTranslation =
                                                                                                                                                                  await db.CheckListTranslations.AsNoTracking().FirstOrDefaultAsync(x =>
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 hr to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 1566..1572

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

                                                                                                                                          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

                                                                                                                                                                      foreach (Field subDbField in await db.Fields.AsNoTracking()
                                                                                                                                                                                   .Where(x => x.WorkflowState != Constants.Constants.WorkflowStates.Removed)
                                                                                                                                                                                   .Where(x => x.ParentFieldId == dbField.Id).OrderBy(x => x.DisplayIndex)
                                                                                                                                                                                   .ToListAsync())
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 2 other locations - About 55 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 1602..1605
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 1630..1633

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

                                                                                                                                          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

                                                                                                                                                              foreach (CheckList subList in await db.CheckLists.AsNoTracking()
                                                                                                                                                                           .Where(x => x.WorkflowState != Constants.Constants.WorkflowStates.Removed)
                                                                                                                                                                           .Where(x => x.ParentId == checkList.Id).OrderBy(x => x.DisplayIndex)
                                                                                                                                                                           .ToListAsync())
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 2 other locations - About 55 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 1602..1605
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 1673..1676

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

                                                                                                                                          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

                                                                                                                                                          foreach (CheckList subCheckList in await db.CheckLists.AsNoTracking()
                                                                                                                                                                       .Where(x => x.WorkflowState != Constants.Constants.WorkflowStates.Removed)
                                                                                                                                                                       .Where(x => x.ParentId == mainCheckList.Id).OrderBy(x => x.DisplayIndex)
                                                                                                                                                                       .ToListAsync())
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 2 other locations - About 55 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 1630..1633
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 1673..1676

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

                                                                                                                                          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

                                                                                                                                                              EntityGroup g = new EntityGroup
                                                                                                                                                              {
                                                                                                                                                                  Id = eg.Id,
                                                                                                                                                                  Name = eg.Name,
                                                                                                                                                                  Type = eg.Type,
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 45 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 4831..4842

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

                                                                                                                                          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

                                                                                                                                                          return new EntityGroup
                                                                                                                                                          {
                                                                                                                                                              Id = eG.Id,
                                                                                                                                                              Name = eG.Name,
                                                                                                                                                              Type = eG.Type,
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 45 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 4786..4797

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

                                                                                                                                          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 (checkListTranslation == null)
                                                                                                                                                                  {
                                                                                                                                                                      checkListTranslation =
                                                                                                                                                                          await db.CheckListTranslations.FirstAsync(x => x.CheckListId == cl.Id);
                                                                                                                                                                      language =
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 45 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 220..225

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

                                                                                                                                          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 (checkListTranslation == null)
                                                                                                                                                          {
                                                                                                                                                              checkListTranslation =
                                                                                                                                                                  await db.CheckListTranslations.FirstAsync(x => x.CheckListId == checkList.Id);
                                                                                                                                                              language = await db.Languages.FirstAsync(x => x.Id == checkListTranslation.LanguageId);
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 45 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 7029..7035

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

                                                                                                                                          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

                                                                                                                                                  private void WriteDebugConsoleLogEntry(LogEntry logEntry)
                                                                                                                                                  {
                                                                                                                                                      var oldColor = Console.ForegroundColor;
                                                                                                                                                      Console.ForegroundColor = ConsoleColor.Gray;
                                                                                                                                                      Console.WriteLine($"[DBG] {logEntry.Type}: {logEntry.Message}");
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 3 other locations - About 40 mins to fix
                                                                                                                                          eFormCore/Helpers/ReportHelper.cs on lines 591..597
                                                                                                                                          eFormCore/Helpers/ReportHelper.cs on lines 599..605
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 5718..5724

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

                                                                                                                                          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

                                                                                                                                                  private void WriteErrorConsoleLogEntry(LogEntry logEntry)
                                                                                                                                                  {
                                                                                                                                                      var oldColor = Console.ForegroundColor;
                                                                                                                                                      Console.ForegroundColor = ConsoleColor.Red;
                                                                                                                                                      Console.WriteLine($"[ERR] {logEntry.Type}: {logEntry.Message}");
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 3 other locations - About 40 mins to fix
                                                                                                                                          eFormCore/Helpers/ReportHelper.cs on lines 591..597
                                                                                                                                          eFormCore/Helpers/ReportHelper.cs on lines 599..605
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 5710..5716

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

                                                                                                                                          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

                                                                                                                                                          case Constants.Constants.WorkflowStates.Created:
                                                                                                                                                              matches = await db.Sites.Where(x => x.WorkflowState == Constants.Constants.WorkflowStates.Created)
                                                                                                                                                                  .ToListAsync().ConfigureAwait(false);
                                                                                                                                                              break;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 2 other locations - About 40 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3905..3908
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3909..3912

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

                                                                                                                                          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.CaseSortParameters.SiteName:
                                                                                                                                                                  if (descendingSort)
                                                                                                                                                                      subQuery = subQuery.OrderByDescending(x => x.Site.Name);
                                                                                                                                                                  else
                                                                                                                                                                      subQuery = subQuery.OrderBy(x => x.Site.Name);
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 40 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3447..3452

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

                                                                                                                                          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

                                                                                                                                                              UploadedData ud = new UploadedData
                                                                                                                                                              {
                                                                                                                                                                  Checksum = dU.Checksum,
                                                                                                                                                                  Extension = dU.Extension,
                                                                                                                                                                  CurrentFile = dU.CurrentFile,
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 2 other locations - About 40 mins to fix
                                                                                                                                          eFormCore/Core.cs on lines 5047..5057
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 2070..2080

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

                                                                                                                                          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

                                                                                                                                                                          UploadedData uploadedDataObj = new UploadedData
                                                                                                                                                                          {
                                                                                                                                                                              Checksum = uploadedData.Checksum,
                                                                                                                                                                              Extension = uploadedData.Extension,
                                                                                                                                                                              CurrentFile = uploadedData.CurrentFile,
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 2 other locations - About 40 mins to fix
                                                                                                                                          eFormCore/Core.cs on lines 5047..5057
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 2862..2872

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

                                                                                                                                          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

                                                                                                                                                          case Constants.Constants.WorkflowStates.NotRemoved:
                                                                                                                                                              matches = await db.Sites.Where(x => x.WorkflowState != Constants.Constants.WorkflowStates.Removed)
                                                                                                                                                                  .ToListAsync().ConfigureAwait(false);
                                                                                                                                                              break;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 2 other locations - About 40 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3909..3912
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3913..3916

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

                                                                                                                                          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.CaseSortParameters.WorkerName:
                                                                                                                                                                  if (descendingSort)
                                                                                                                                                                      subQuery = subQuery.OrderByDescending(x => x.Worker.FirstName);
                                                                                                                                                                  else
                                                                                                                                                                      subQuery = subQuery.OrderBy(x => x.Worker.FirstName);
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 40 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3453..3458

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

                                                                                                                                          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

                                                                                                                                                          case Constants.Constants.WorkflowStates.Removed:
                                                                                                                                                              matches = await db.Sites.Where(x => x.WorkflowState == Constants.Constants.WorkflowStates.Removed)
                                                                                                                                                                  .ToListAsync().ConfigureAwait(false);
                                                                                                                                                              break;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 2 other locations - About 40 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3905..3908
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3913..3916

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

                                                                                                                                          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

                                                                                                                                                              List<Tagging> taggingMatches = await db.Taggings.Where(x =>
                                                                                                                                                                  x.CheckListId == checkList.Id
                                                                                                                                                                  && x.WorkflowState != Constants.Constants.WorkflowStates.Removed).ToListAsync();
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 197..201

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

                                                                                                                                          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

                                                                                                                                                          List<CheckListSite> checkListSites =
                                                                                                                                                              await db.CheckListSites.Where(x =>
                                                                                                                                                                      x.CheckListId == checkList.Id &&
                                                                                                                                                                      x.WorkflowState != Constants.Constants.WorkflowStates.Removed)
                                                                                                                                                                  .ToListAsync();
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 574..576

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

                                                                                                                                          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

                                                                                                                                                              case Constants.Constants.CaseSortParameters.Field7:
                                                                                                                                                                  if (descendingSort)
                                                                                                                                                                      subQuery = subQuery.OrderByDescending(x => x.FieldValue7);
                                                                                                                                                                  else
                                                                                                                                                                      subQuery = subQuery.OrderBy(x => x.FieldValue7);
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 13 other locations - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3435..3440
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3441..3446
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3459..3464
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3465..3470
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3471..3476
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3477..3482
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3483..3488
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3489..3494
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3495..3500
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3501..3506
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3513..3518
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3519..3524
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3525..3530

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

                                                                                                                                          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

                                                                                                                                                              case Constants.Constants.CaseSortParameters.Field9:
                                                                                                                                                                  if (descendingSort)
                                                                                                                                                                      subQuery = subQuery.OrderByDescending(x => x.FieldValue9);
                                                                                                                                                                  else
                                                                                                                                                                      subQuery = subQuery.OrderBy(x => x.FieldValue9);
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 13 other locations - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3435..3440
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3441..3446
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3459..3464
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3465..3470
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3471..3476
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3477..3482
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3483..3488
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3489..3494
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3495..3500
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3501..3506
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3507..3512
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3513..3518
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3525..3530

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

                                                                                                                                          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

                                                                                                                                                              case Constants.Constants.CaseSortParameters.Field1:
                                                                                                                                                                  if (descendingSort)
                                                                                                                                                                      subQuery = subQuery.OrderByDescending(x => x.FieldValue1);
                                                                                                                                                                  else
                                                                                                                                                                      subQuery = subQuery.OrderBy(x => x.FieldValue1);
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 13 other locations - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3435..3440
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3441..3446
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3459..3464
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3465..3470
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3477..3482
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3483..3488
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3489..3494
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3495..3500
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3501..3506
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3507..3512
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3513..3518
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3519..3524
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3525..3530

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

                                                                                                                                          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

                                                                                                                                                              case Constants.Constants.CaseSortParameters.Field6:
                                                                                                                                                                  if (descendingSort)
                                                                                                                                                                      subQuery = subQuery.OrderByDescending(x => x.FieldValue6);
                                                                                                                                                                  else
                                                                                                                                                                      subQuery = subQuery.OrderBy(x => x.FieldValue6);
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 13 other locations - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3435..3440
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3441..3446
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3459..3464
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3465..3470
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3471..3476
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3477..3482
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3483..3488
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3489..3494
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3495..3500
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3507..3512
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3513..3518
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3519..3524
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3525..3530

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

                                                                                                                                          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

                                                                                                                                                              case Constants.Constants.CaseSortParameters.Field10:
                                                                                                                                                                  if (descendingSort)
                                                                                                                                                                      subQuery = subQuery.OrderByDescending(x => x.FieldValue10);
                                                                                                                                                                  else
                                                                                                                                                                      subQuery = subQuery.OrderBy(x => x.FieldValue10);
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 13 other locations - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3435..3440
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3441..3446
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3459..3464
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3465..3470
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3471..3476
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3477..3482
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3483..3488
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3489..3494
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3495..3500
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3501..3506
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3507..3512
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3513..3518
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3519..3524

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

                                                                                                                                          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

                                                                                                                                                              case Constants.Constants.CaseSortParameters.Field5:
                                                                                                                                                                  if (descendingSort)
                                                                                                                                                                      subQuery = subQuery.OrderByDescending(x => x.FieldValue5);
                                                                                                                                                                  else
                                                                                                                                                                      subQuery = subQuery.OrderBy(x => x.FieldValue5);
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 13 other locations - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3435..3440
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3441..3446
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3459..3464
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3465..3470
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3471..3476
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3477..3482
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3483..3488
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3489..3494
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3501..3506
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3507..3512
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3513..3518
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3519..3524
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3525..3530

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

                                                                                                                                          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

                                                                                                                                                              case Constants.Constants.CaseSortParameters.Field8:
                                                                                                                                                                  if (descendingSort)
                                                                                                                                                                      subQuery = subQuery.OrderByDescending(x => x.FieldValue8);
                                                                                                                                                                  else
                                                                                                                                                                      subQuery = subQuery.OrderBy(x => x.FieldValue8);
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 13 other locations - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3435..3440
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3441..3446
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3459..3464
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3465..3470
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3471..3476
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3477..3482
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3483..3488
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3489..3494
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3495..3500
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3501..3506
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3507..3512
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3519..3524
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3525..3530

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

                                                                                                                                          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

                                                                                                                                                              case Constants.Constants.CaseSortParameters.Status:
                                                                                                                                                                  if (descendingSort)
                                                                                                                                                                      subQuery = subQuery.OrderByDescending(x => x.Status);
                                                                                                                                                                  else
                                                                                                                                                                      subQuery = subQuery.OrderBy(x => x.Status);
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 13 other locations - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3435..3440
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3441..3446
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3459..3464
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3471..3476
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3477..3482
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3483..3488
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3489..3494
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3495..3500
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3501..3506
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3507..3512
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3513..3518
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3519..3524
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3525..3530

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

                                                                                                                                          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

                                                                                                                                                              case Constants.Constants.CaseSortParameters.CreatedAt:
                                                                                                                                                                  if (descendingSort)
                                                                                                                                                                      subQuery = subQuery.OrderByDescending(x => x.Id);
                                                                                                                                                                  else
                                                                                                                                                                      subQuery = subQuery.OrderBy(x => x.Id);
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 13 other locations - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3441..3446
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3459..3464
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3465..3470
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3471..3476
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3477..3482
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3483..3488
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3489..3494
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3495..3500
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3501..3506
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3507..3512
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3513..3518
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3519..3524
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3525..3530

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

                                                                                                                                          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

                                                                                                                                                              case Constants.Constants.CaseSortParameters.Field2:
                                                                                                                                                                  if (descendingSort)
                                                                                                                                                                      subQuery = subQuery.OrderByDescending(x => x.FieldValue2);
                                                                                                                                                                  else
                                                                                                                                                                      subQuery = subQuery.OrderBy(x => x.FieldValue2);
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 13 other locations - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3435..3440
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3441..3446
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3459..3464
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3465..3470
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3471..3476
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3483..3488
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3489..3494
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3495..3500
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3501..3506
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3507..3512
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3513..3518
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3519..3524
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3525..3530

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

                                                                                                                                          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

                                                                                                                                                              case Constants.Constants.CaseSortParameters.UnitId:
                                                                                                                                                                  if (descendingSort)
                                                                                                                                                                      subQuery = subQuery.OrderByDescending(x => x.UnitId);
                                                                                                                                                                  else
                                                                                                                                                                      subQuery = subQuery.OrderBy(x => x.UnitId);
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 13 other locations - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3435..3440
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3441..3446
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3465..3470
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3471..3476
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3477..3482
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3483..3488
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3489..3494
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3495..3500
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3501..3506
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3507..3512
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3513..3518
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3519..3524
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3525..3530

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

                                                                                                                                          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

                                                                                                                                                                  await db.ExtraFieldValues.Where(x =>
                                                                                                                                                                      x.CaseId == theCase.Id
                                                                                                                                                                      && x.CheckListId == checkList.Id
                                                                                                                                                                      && x.WorkflowState != Constants.Constants.WorkflowStates.Removed
                                                                                                                                                                  ).ToListAsync();
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 2 other locations - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 1712..1716
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 1782..1786

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

                                                                                                                                          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

                                                                                                                                                              case Constants.Constants.CaseSortParameters.Field4:
                                                                                                                                                                  if (descendingSort)
                                                                                                                                                                      subQuery = subQuery.OrderByDescending(x => x.FieldValue4);
                                                                                                                                                                  else
                                                                                                                                                                      subQuery = subQuery.OrderBy(x => x.FieldValue4);
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 13 other locations - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3435..3440
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3441..3446
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3459..3464
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3465..3470
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3471..3476
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3477..3482
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3483..3488
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3495..3500
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3501..3506
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3507..3512
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3513..3518
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3519..3524
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3525..3530

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

                                                                                                                                          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

                                                                                                                                                                      foreach (var fieldValue in await db.FieldValues.Where(x =>
                                                                                                                                                                                       x.FieldId == dbField.Id
                                                                                                                                                                                       && x.CaseId == theCase.Id
                                                                                                                                                                                       && x.WorkflowState != Constants.Constants.WorkflowStates.Removed)
                                                                                                                                                                                   .ToListAsync())
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 2 other locations - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 1712..1716
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 1797..1801

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

                                                                                                                                          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

                                                                                                                                                              case Constants.Constants.CaseSortParameters.DoneAt:
                                                                                                                                                                  if (descendingSort)
                                                                                                                                                                      subQuery = subQuery.OrderByDescending(x => x.DoneAtUserModifiable);
                                                                                                                                                                  else
                                                                                                                                                                      subQuery = subQuery.OrderBy(x => x.DoneAtUserModifiable);
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 13 other locations - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3435..3440
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3459..3464
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3465..3470
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3471..3476
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3477..3482
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3483..3488
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3489..3494
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3495..3500
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3501..3506
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3507..3512
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3513..3518
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3519..3524
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3525..3530

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

                                                                                                                                          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

                                                                                                                                                              case Constants.Constants.CaseSortParameters.Field3:
                                                                                                                                                                  if (descendingSort)
                                                                                                                                                                      subQuery = subQuery.OrderByDescending(x => x.FieldValue3);
                                                                                                                                                                  else
                                                                                                                                                                      subQuery = subQuery.OrderBy(x => x.FieldValue3);
                                                                                                                                          Severity: Major
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 13 other locations - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3435..3440
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3441..3446
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3459..3464
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3465..3470
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3471..3476
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3477..3482
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3489..3494
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3495..3500
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3501..3506
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3507..3512
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3513..3518
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3519..3524
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3525..3530

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

                                                                                                                                          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 (match.WorkerId != null)
                                                                                                                                                                  match.WorkerId = db.Workers.AsNoTracking().FirstAsync(x => x.Id == match.WorkerId).GetAwaiter()
                                                                                                                                                                      .GetResult()
                                                                                                                                                                      .MicrotingUid;
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3241..3244

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

                                                                                                                                          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 (match.UnitId != null)
                                                                                                                                                                  match.UnitId = db.Units.AsNoTracking().FirstAsync(x => x.Id == match.UnitId).GetAwaiter()
                                                                                                                                                                      .GetResult()
                                                                                                                                                                      .MicrotingUid;
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 3246..3249

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

                                                                                                                                          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

                                                                                                                                                                          foreach (FieldValue fieldValue in await db.FieldValues.Where(x =>
                                                                                                                                                                                           x.FieldId == subDbField.Id
                                                                                                                                                                                           && x.CaseId == theCase.Id
                                                                                                                                                                                           && x.WorkflowState != Constants.Constants.WorkflowStates.Removed)
                                                                                                                                                                                       .ToListAsync())
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 2 other locations - About 35 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 1782..1786
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 1797..1801

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

                                                                                                                                          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

                                                                                                                                                              WorkerDto workerDto = new WorkerDto
                                                                                                                                                              {
                                                                                                                                                                  WorkerUId = worker.MicrotingUid,
                                                                                                                                                                  FirstName = worker.FirstName,
                                                                                                                                                                  LastName = worker.LastName,
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 35 mins to fix
                                                                                                                                          eFormSDK.Integration.CheckLists.CoreTests/CoreTestAdvanced.cs on lines 1346..1355

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

                                                                                                                                          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 ",":
                                                                                                                                                                              {
                                                                                                                                                                                  replyLst1.Add(new KeyValuePair(item.CaseId.ToString(),
                                                                                                                                                                                      String.Format("{0:#,##0.##}", item.Value), false, ""));
                                                                                                                                                                              }
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 30 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 2646..2651

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

                                                                                                                                          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 ".":
                                                                                                                                                                              {
                                                                                                                                                                                  replyLst1.Add(new KeyValuePair(item.CaseId.ToString(),
                                                                                                                                                                                      String.Format("{0:#.##0.##}", item.Value), false, ""));
                                                                                                                                                                              }
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 30 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 2652..2657

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

                                                                                                                                          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

                                                                                                                                                              case Constants.Constants.WorkflowStates.NotRemoved:
                                                                                                                                                                  matches = await db.Workers
                                                                                                                                                                      .Where(x => x.WorkflowState != Constants.Constants.WorkflowStates.Removed).ToListAsync();
                                                                                                                                                                  break;
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 2 other locations - About 30 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 4170..4173
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 4174..4177

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

                                                                                                                                          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

                                                                                                                                                              case Constants.Constants.WorkflowStates.Removed:
                                                                                                                                                                  matches = await db.Workers
                                                                                                                                                                      .Where(x => x.WorkflowState == Constants.Constants.WorkflowStates.Removed).ToListAsync();
                                                                                                                                                                  break;
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 2 other locations - About 30 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 4166..4169
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 4174..4177

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

                                                                                                                                          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

                                                                                                                                                              case Constants.Constants.WorkflowStates.Created:
                                                                                                                                                                  matches = await db.Workers
                                                                                                                                                                      .Where(x => x.WorkflowState == Constants.Constants.WorkflowStates.Created).ToListAsync();
                                                                                                                                                                  break;
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 2 other locations - About 30 mins to fix
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 4166..4169
                                                                                                                                          eFormCore/Infrastructure/SqlController.cs on lines 4170..4173

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

                                                                                                                                          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

                                                                                                                                                                  {
                                                                                                                                                                      FieldOptionTranslation fieldOptionTranslation =
                                                                                                                                                                          await db.FieldOptionTranslations.FirstAsync(x =>
                                                                                                                                                                              x.FieldOptionId == fieldOption.Id && x.LanguageId == language.Id);
                                                                                                                                                                      //string fullKey = _t.Locate(item.Field.KeyValuePairList, "<" + key + ">", "</" + key + ">");
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 30 mins to fix
                                                                                                                                          eFormCore/Core.cs on lines 5591..5596

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

                                                                                                                                          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

                                                                                                                                          There are no issues that match your filters.

                                                                                                                                          Category
                                                                                                                                          Status