microting/eform-sdk-dotnet

View on GitHub

Showing 886 of 3,221 total issues

Method DataItemGetAllFromList has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        private List<DataItem> DataItemGetAllFromList(List<Element> elements, List<DataItem> dataItemLst)
        {
            foreach (Element element in elements)
            {
                if (element.GetType() == typeof(DataElement))
Severity: Minor
Found in eFormCore/Infrastructure/Models/MainElement.cs - About 1 hr to fix

    Method CreateFieldValue has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            public async Task<FieldValue> CreateFieldValue(Case aCase, CheckList checkList, Field f, int? ud_id,
                int? userId, string value, int? version, Worker worker)
            {
                FieldValue fv = new FieldValue
                {
    Severity: Minor
    Found in eFormCore/Helpers/TestHelpers.cs - About 1 hr to fix

      Method CaseRead has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public async Task<ReplyElement> CaseRead(int microtingUId, int checkUId, Language language)
              {
                  string methodName = "Core.CaseRead";
                  try
                  {
      Severity: Minor
      Found in eFormCore/Core.cs - About 1 hr to fix

        Method SplitToList has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public string SplitToList(string textToBeSplit, byte index, bool lastInstedOfFirst)
                {
                    try
                    {
                        if (string.IsNullOrEmpty(textToBeSplit))
        Severity: Minor
        Found in eFormCore/Tools.cs - About 1 hr to fix

          Method InsertHeader has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public static void InsertHeader(string header, WordprocessingDocument wordDoc, string currentHeader)
                  {
                      WriteDebugConsoleLogEntry(new LogEntry(2, "ReportHelper", "InsertHeader called"));
                      // If currentHeader is not equal to new header, insert new header.
                      try
          Severity: Minor
          Found in eFormCore/Helpers/ReportHelper.cs - About 1 hr to fix

            Method CoreThread has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    private async Task CoreThread()
                    {
                        _coreThreadRunning = true;
            
                        string methodName = "Core.CoreThread";
            Severity: Minor
            Found in eFormCore/Core.cs - About 1 hr to fix

              Method Advanced_UploadedDataRead has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                Method FolderDelete has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        public async Task FolderDelete(int id)
                        {
                            string methodName = "Core.FolderDelete";
                            try
                            {
                Severity: Minor
                Found in eFormCore/Core.cs - About 1 hr to fix

                  Method DoSetup has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          public override async Task DoSetup()
                          {
                              #region Setup SettingsTableContent
                  
                              DbContextHelper dbContextHelper = new DbContextHelper(ConnectionString);
                  Severity: Minor
                  Found in eFormSDK.Integration.Case.CoreTests/CoreTest.cs - About 1 hr to fix

                    Method Core_Case_CaseDeleteResult_DoesMarkCaseRemoved has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            [Test]
                            public async Task Core_Case_CaseDeleteResult_DoesMarkCaseRemoved()
                            {
                                // Arrance
                                Site site = new Site();
                    Severity: Minor
                    Found in eFormSDK.Integration.Case.CoreTests/CoreTestCase.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 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 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 CreateFieldValue has 8 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    public async Task<FieldValue> CreateFieldValue(Case aCase, CheckList checkList, Field f, int? ud_id,
                                        int? userId, string value, int? version, Worker worker)
                            Severity: Major
                            Found in eFormCore/Helpers/TestHelpers.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/Core.cs - About 1 hr to fix

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

                                        public async Task<CheckList> CreateTemplate(DateTime cl_ca, DateTime cl_ua, string label, string description,
                                            string caseType, string folderName, int displayIndex, int repeated)
                                Severity: Major
                                Found in eFormCore/Helpers/TestHelpers.cs - About 1 hr to fix

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

                                          public async Task<List<Case>> CaseReadAll(int? templateId, DateTime? start, DateTime? end, string workflowState,
                                              string searchKey, bool descendingSort, string sortParameter, TimeZoneInfo timeZoneInfo)
                                  Severity: Major
                                  Found in eFormCore/Core.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 CaseDelete has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring.
                                    Open

                                            public async Task<bool> CaseDelete(int microtingUId)
                                            {
                                                string methodName = "Core.CaseDelete";
                                    
                                                Log.LogVariable(methodName, nameof(microtingUId), microtingUId);
                                    Severity: Minor
                                    Found in eFormCore/Core.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 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
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language