Skip to content

WizardController

  • Namespace: Insorce.Controllers
  • Project: Andromeda.Web

Overview

The WizardController manages project workflow automation features, integrating predictive analytics and diagnostics to support process optimization and decision-making.

Feature Summary

  • Implements project activity and actor management with workflow path construction.
  • Provides endpoints for predictions including product, forms, business rules, AHT, controls, salary, deadlines, and decision percentages.
  • Supports diagnostics retrieval and analysis such as diagnoses, NVA solutions, and chatbot interactions.
  • Handles JSON data import/export for project configurations and final outputs.
  • Processes map rejection and wait type handling with external API integrations.
  • Verifies industry alignment for entities to ensure data consistency.

UX Summary

  • Conditional redirects and JSON responses guide user navigation and interface updates.
  • Long-running or blocking HTTP calls degrade frontend responsiveness and user experience.
  • Error handling often returns generic false JSON, limiting user feedback clarity.
  • Downloading JSON files may disrupt workflow if files are large or unexpected.
  • Lack of detailed error messages and feedback can hinder troubleshooting and user confidence.

Data Dependencies

  • Relies on external APIs for predictions, diagnostics, and GENAI services with HTTP client calls.
  • Uses project repositories and models to retrieve and update project, activity, actor, and configuration data.
  • Processes JSON payloads extensively for input parsing, data transformation, and output generation.
  • Interacts with configuration storage for saving updated project states and prediction results.

Authentication / Authorization Notes

  • API key usage is inconsistent and often missing or empty, posing security risks.
  • Authentication headers are sometimes set with empty strings, risking unauthorized access.
  • No explicit user permission checks are evident, increasing potential exposure of sensitive operations.
  • Input validation and sanitization are insufficient, increasing vulnerability to injection attacks.

Controller Call Chain Diagram

flowchart TD
    Andromeda_Core_DataManager_Execute["Andromeda.Core.DataManager.Execute"]
    Andromeda_Core_DataManager_GetData["Andromeda.Core.DataManager.GetData"]
    Andromeda_Core_Database_helper_SqlParameters["Andromeda.Core.Database.helper.SqlParameters"]
    Andromeda_Core_Entities_Activity_GetNVAType["Andromeda.Core.Entities.Activity.GetNVAType"]
    Andromeda_Core_Entities_Activity_ReworkEffort["Andromeda.Core.Entities.Activity.ReworkEffort"]
    Andromeda_Core_Entities_Activity_TotalEffort["Andromeda.Core.Entities.Activity.TotalEffort"]
    Andromeda_Core_Entities_Actor_GetLocation["Andromeda.Core.Entities.Actor.GetLocation"]
    Andromeda_Core_Entities_Actor_WorkEndTimeInProjectZone["Andromeda.Core.Entities.Actor.WorkEndTimeInProjectZone"]
    Andromeda_Core_Entities_Actor_WorkEndTimeUTC["Andromeda.Core.Entities.Actor.WorkEndTimeUTC"]
    Andromeda_Core_Entities_Actor_WorkStartTimeInProjectZone["Andromeda.Core.Entities.Actor.WorkStartTimeInProjectZone"]
    Andromeda_Core_Entities_Actor_WorkStartTimeUTC["Andromeda.Core.Entities.Actor.WorkStartTimeUTC"]
    Andromeda_Core_Entities_Arrow_Clone["Andromeda.Core.Entities.Arrow.Clone"]
    Andromeda_Core_Entities_EdgeInfo_Clone["Andromeda.Core.Entities.EdgeInfo.Clone"]
    Andromeda_Core_Entities_PathData_GetPathIds["Andromeda.Core.Entities.PathData.GetPathIds"]
    Andromeda_Core_Extensions_LinqExtensions_RemoveInvalidFileNameChars["Andromeda.Core.Extensions.LinqExtensions.RemoveInvalidFileNameChars"]
    Andromeda_Core_Extensions_LinqExtensions_getSkillScore["Andromeda.Core.Extensions.LinqExtensions.getSkillScore"]
    Andromeda_Core_LoggingManager_Debug["Andromeda.Core.LoggingManager.Debug"]
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Exception["Andromeda.Core.LoggingManager.Exception"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    Andromeda_Core_Services_ExcelGenerator_CloneRow["Andromeda.Core.Services.ExcelGenerator.CloneRow"]
    Andromeda_Core_Services_ExcelGenerator_UpdateCell["Andromeda.Core.Services.ExcelGenerator.UpdateCell"]
    Andromeda_Core_Services_ProcessExtensions_FindByID["Andromeda.Core.Services.ProcessExtensions.FindByID"]
    Insorce_Helpers_Helpers_GetIndividualPath["Insorce.Helpers.Helpers.GetIndividualPath"]
    Insorce_Helpers_InsorceOpenAICalls_CheckBusinessRule["Insorce.Helpers.InsorceOpenAICalls.CheckBusinessRule"]
    Insorce_Helpers_InsorceOpenAICalls_CheckForm["Insorce.Helpers.InsorceOpenAICalls.CheckForm"]
    Insorce_Helpers_InsorceOpenAICalls_CheckProduct["Insorce.Helpers.InsorceOpenAICalls.CheckProduct"]
    System_Web_Mvc_LargeJsonResult_JsonEncode["System.Web.Mvc.LargeJsonResult.JsonEncode"]
    WizardController_AHTPredictions["WizardController.AHTPredictions"]
    WizardController_BusinessRulesPredictions["WizardController.BusinessRulesPredictions"]
    WizardController_CheckEnrichStatus["WizardController.CheckEnrichStatus"]
    WizardController_ControlsPredictions["WizardController.ControlsPredictions"]
    WizardController_DeadlinesGENAI["WizardController.DeadlinesGENAI"]
    WizardController_FormsPredictions["WizardController.FormsPredictions"]
    WizardController_GetAgentData["WizardController.GetAgentData"]
    WizardController_GetAgentJsonData["WizardController.GetAgentJsonData"]
    WizardController_GetAll_Diagnoses["WizardController.GetAll_Diagnoses"]
    WizardController_GetCX_Summary_Diagnoses["WizardController.GetCX_Summary_Diagnoses"]
    WizardController_GetInputData["WizardController.GetInputData"]
    WizardController_GetInputDataJson["WizardController.GetInputDataJson"]
    WizardController_GetNVA_solution["WizardController.GetNVA_solution"]
    WizardController_GetPeak_Diagnoses["WizardController.GetPeak_Diagnoses"]
    WizardController_ProcessMaprejectionGENAI["WizardController.ProcessMaprejectionGENAI"]
    WizardController_ProductPredictions["WizardController.ProductPredictions"]
    WizardController_UpdateFinalJSONData["WizardController.UpdateFinalJSONData"]
    WizardController_VerifyBelongsToSameIndustry["WizardController.VerifyBelongsToSameIndustry"]
    WizardController_Wizard_AHT["WizardController.Wizard_AHT"]
    WizardController_Wizard_BRules["WizardController.Wizard_BRules"]
    WizardController_Wizard_Controls["WizardController.Wizard_Controls"]
    WizardController_Wizard_DOE["WizardController.Wizard_DOE"]
    WizardController_Wizard_Deadline["WizardController.Wizard_Deadline"]
    WizardController_Wizard_DecisionPercentage["WizardController.Wizard_DecisionPercentage"]
    WizardController_Wizard_Forms["WizardController.Wizard_Forms"]
    WizardController_Wizard_NVA["WizardController.Wizard_NVA"]
    WizardController_Wizard_ProcessMapRejection["WizardController.Wizard_ProcessMapRejection"]
    WizardController_Wizard_Product["WizardController.Wizard_Product"]
    WizardController_Wizard_Salary["WizardController.Wizard_Salary"]
    WizardController_Wizard_Waittype["WizardController.Wizard_Waittype"]
    Andromeda_Core_DataManager_Execute --> Andromeda_Core_Database_helper_SqlParameters
    Andromeda_Core_DataManager_Execute --> Andromeda_Core_LoggingManager_Debug
    Andromeda_Core_Entities_Actor_GetLocation --> Andromeda_Core_DataManager_GetData
    Insorce_Helpers_Helpers_GetIndividualPath --> Andromeda_Core_Entities_Arrow_Clone
    Insorce_Helpers_Helpers_GetIndividualPath --> Andromeda_Core_Entities_EdgeInfo_Clone
    Insorce_Helpers_InsorceOpenAICalls_CheckBusinessRule --> Andromeda_Core_LoggingManager_Error
    Insorce_Helpers_InsorceOpenAICalls_CheckForm --> Andromeda_Core_LoggingManager_Error
    Insorce_Helpers_InsorceOpenAICalls_CheckProduct --> Andromeda_Core_LoggingManager_Error
    WizardController_AHTPredictions --> Andromeda_Core_LoggingManager_Error
    WizardController_AHTPredictions --> Andromeda_Core_LoggingManager_Info
    WizardController_BusinessRulesPredictions --> Andromeda_Core_LoggingManager_Error
    WizardController_BusinessRulesPredictions --> Andromeda_Core_LoggingManager_Info
    WizardController_CheckEnrichStatus --> Andromeda_Core_LoggingManager_Info
    WizardController_ControlsPredictions --> Andromeda_Core_LoggingManager_Error
    WizardController_ControlsPredictions --> Andromeda_Core_LoggingManager_Info
    WizardController_DeadlinesGENAI --> Andromeda_Core_LoggingManager_Error
    WizardController_DeadlinesGENAI --> Andromeda_Core_LoggingManager_Info
    WizardController_FormsPredictions --> Andromeda_Core_LoggingManager_Error
    WizardController_FormsPredictions --> Andromeda_Core_LoggingManager_Info
    WizardController_GetAgentData --> Andromeda_Core_Entities_Activity_GetNVAType
    WizardController_GetAgentData --> Andromeda_Core_Entities_Activity_ReworkEffort
    WizardController_GetAgentData --> Andromeda_Core_Entities_Activity_TotalEffort
    WizardController_GetAgentData --> Andromeda_Core_Entities_Actor_GetLocation
    WizardController_GetAgentData --> Andromeda_Core_Entities_Actor_WorkEndTimeInProjectZone
    WizardController_GetAgentData --> Andromeda_Core_Entities_Actor_WorkStartTimeInProjectZone
    WizardController_GetAgentData --> Andromeda_Core_Entities_Arrow_Clone
    WizardController_GetAgentData --> Andromeda_Core_Extensions_LinqExtensions_RemoveInvalidFileNameChars
    WizardController_GetAgentData --> Andromeda_Core_Extensions_LinqExtensions_getSkillScore
    WizardController_GetAgentData --> Andromeda_Core_Services_ExcelGenerator_CloneRow
    WizardController_GetAgentData --> Andromeda_Core_Services_ExcelGenerator_UpdateCell
    WizardController_GetAgentData --> Andromeda_Core_Services_ProcessExtensions_FindByID
    WizardController_GetAgentData --> Insorce_Helpers_Helpers_GetIndividualPath
    WizardController_GetAgentJsonData --> System_Web_Mvc_LargeJsonResult_JsonEncode
    WizardController_GetAll_Diagnoses --> Andromeda_Core_LoggingManager_Error
    WizardController_GetAll_Diagnoses --> Andromeda_Core_LoggingManager_Exception
    WizardController_GetAll_Diagnoses --> Andromeda_Core_LoggingManager_Info
    WizardController_GetAll_Diagnoses --> System_Web_Mvc_LargeJsonResult_JsonEncode
    WizardController_GetCX_Summary_Diagnoses --> Andromeda_Core_LoggingManager_Error
    WizardController_GetInputData --> Andromeda_Core_Entities_Actor_GetLocation
    WizardController_GetInputData --> Andromeda_Core_Entities_Actor_WorkEndTimeUTC
    WizardController_GetInputData --> Andromeda_Core_Entities_Actor_WorkStartTimeUTC
    WizardController_GetInputData --> Andromeda_Core_Entities_PathData_GetPathIds
    WizardController_GetInputData --> Andromeda_Core_Extensions_LinqExtensions_getSkillScore
    WizardController_GetInputDataJson --> System_Web_Mvc_LargeJsonResult_JsonEncode
    WizardController_GetNVA_solution --> Andromeda_Core_LoggingManager_Error
    WizardController_GetNVA_solution --> Andromeda_Core_LoggingManager_Info
    WizardController_GetNVA_solution --> System_Web_Mvc_LargeJsonResult_JsonEncode
    WizardController_GetPeak_Diagnoses --> Andromeda_Core_LoggingManager_Error
    WizardController_GetPeak_Diagnoses --> Andromeda_Core_LoggingManager_Info
    WizardController_GetPeak_Diagnoses --> System_Web_Mvc_LargeJsonResult_JsonEncode
    WizardController_ProcessMaprejectionGENAI --> Andromeda_Core_LoggingManager_Error
    WizardController_ProcessMaprejectionGENAI --> Andromeda_Core_LoggingManager_Info
    WizardController_ProductPredictions --> Andromeda_Core_LoggingManager_Error
    WizardController_ProductPredictions --> Andromeda_Core_LoggingManager_Info
    WizardController_UpdateFinalJSONData --> Andromeda_Core_DataManager_Execute
    WizardController_VerifyBelongsToSameIndustry --> Insorce_Helpers_InsorceOpenAICalls_CheckBusinessRule
    WizardController_VerifyBelongsToSameIndustry --> Insorce_Helpers_InsorceOpenAICalls_CheckForm
    WizardController_VerifyBelongsToSameIndustry --> Insorce_Helpers_InsorceOpenAICalls_CheckProduct
    WizardController_Wizard_AHT --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_AHT --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_AHT --> System_Web_Mvc_LargeJsonResult_JsonEncode
    WizardController_Wizard_BRules --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_BRules --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_BRules --> System_Web_Mvc_LargeJsonResult_JsonEncode
    WizardController_Wizard_Controls --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_Controls --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_Controls --> System_Web_Mvc_LargeJsonResult_JsonEncode
    WizardController_Wizard_DOE --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_DOE --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_DOE --> System_Web_Mvc_LargeJsonResult_JsonEncode
    WizardController_Wizard_Deadline --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_Deadline --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_Deadline --> System_Web_Mvc_LargeJsonResult_JsonEncode
    WizardController_Wizard_DecisionPercentage --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_DecisionPercentage --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_DecisionPercentage --> System_Web_Mvc_LargeJsonResult_JsonEncode
    WizardController_Wizard_Forms --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_Forms --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_Forms --> System_Web_Mvc_LargeJsonResult_JsonEncode
    WizardController_Wizard_NVA --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_NVA --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_NVA --> System_Web_Mvc_LargeJsonResult_JsonEncode
    WizardController_Wizard_ProcessMapRejection --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_ProcessMapRejection --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_ProcessMapRejection --> System_Web_Mvc_LargeJsonResult_JsonEncode
    WizardController_Wizard_Product --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_Product --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_Product --> System_Web_Mvc_LargeJsonResult_JsonEncode
    WizardController_Wizard_Salary --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_Salary --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_Salary --> System_Web_Mvc_LargeJsonResult_JsonEncode
    WizardController_Wizard_Waittype --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_Waittype --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_Waittype --> System_Web_Mvc_LargeJsonResult_JsonEncode

System Dependencies

Incoming Dependencies (Fan-In): None

Outgoing Dependencies (Fan-Out): None

Cycle Detection

No dependency cycles detected for this controller.

View → Action Mapping

Action View Model Path
createwizard CreateWizard - Andromeda.Web\Views\Wizard\CreateWizard.cshtml
mapexcelcolumns MapExcelColumns - Andromeda.Web\Views\Wizard\MapExcelColumns.cshtml
mapvisioshapes MapVisioShapes - Andromeda.Web\Views\Wizard\MapVisioShapes.cshtml
workhistory WorkHistory IList<Andromeda.Core.Entities.WizardProject> Andromeda.Web\Views\Wizard\WorkHistory.cshtml
workprogress WorkProgress - Andromeda.Web\Views\Wizard\WorkProgress.cshtml

Methods at a Glance

Command / Save Operations

Type Method HTTP URL Summary
entrypoint GetActivityFromJson `` /Wizard/GetActivityFromJson Parse JSON array to create and populate ActivityTemplate objects with...
entrypoint ProductPredictions POST /Wizard/ProductPredictions Decode request JSON, send it via POST to the product predictions API, and...
entrypoint FormsPredictions POST /Wizard/FormsPredictions Decode JSON request, send it via HTTP POST to the prediction endpoint, and...
entrypoint AHTPredictions POST /Wizard/AHTPredictions Decode JSON request, send POST to external API with API key, return successful...
entrypoint ControlsPredictions POST /Wizard/ControlsPredictions Decode JSON from POST request, send it to external API synchronously, log...
entrypoint GetPeak_Diagnoses GET /Wizard/GetPeak_Diagnoses Retrieve peak diagnostic data from the agent, update the diagnoses JSON, and...
entrypoint GetCX_Summary_Diagnoses GET /Wizard/GetCX_Summary_Diagnoses Retrieve, decode, and serialize diagnoses data, post it to an endpoint, update...
entrypoint GetNVA_solution GET /Wizard/GetNVA_solution Retrieve agent data, send it via POST to the diagnostics endpoint, and return...

File & Import Operations

Type Method HTTP URL Summary
entrypoint DownloadWizardInputJson GET /Wizard/DownloadWizardInputJson DownloadWizardInputJson retrieves project ID, fetches project details, obtains...
entrypoint DownloadWizardFinalJson GET /Wizard/DownloadWizardFinalJson DownloadWizardFinalJson retrieves project ID and status, encodes final JSON...

Query & View Methods

Type Method HTTP URL Summary
entrypoint GetAgentJsonData GET /Wizard/GetAgentJsonData GetAgentJsonData retrieves and returns agent data in JSON format.
entrypoint GetAll_Diagnoses GET /Wizard/GetAll_Diagnoses GetAll_Diagnoses returns existing diagnosis data from WizardModel as JSON if...
entrypoint GetInputDataJson GET /Wizard/GetInputDataJson The method handles an HTTP GET request, retrieves data by type, and returns...
entrypoint GetInputData `` /Wizard/GetInputData Retrieve and filter project activities and actors based on type and properties...
entrypoint GetActivityType `` /Wizard/GetActivityType GetActivityType returns 'start' if an arrow's predecessor matches activityId...

Validation & Rules

Type Method HTTP URL Summary
entrypoint CheckEnrichStatus GET /Wizard/CheckEnrichStatus Construct JSON payload, send request, and return JSON response based on HTTP...
entrypoint BusinessRulesPredictions POST /Wizard/BusinessRulesPredictions Decode request JSON, send synchronous POST to external API, log and return...
entrypoint ProcessMaprejectionGENAI POST /Wizard/ProcessMaprejectionGENAI Synchronously wait for API response, verify success, log it, and return JSON...
entrypoint GetChatbotAnswer GET /Wizard/GetChatbotAnswer Build API URL, verify response success, deserialize and return JSON content.
entrypoint Wizard_BRules GET /Wizard/Wizard_BRules Process optional pType, send data to external API, handle response, save...
entrypoint VerifyBelongsToSameIndustry POST /Wizard/VerifyBelongsToSameIndustry VerifyBelongsToSameIndustry checks entity type, validates industry match via...

Workflow & Routing

Type Method HTTP URL Summary
entrypoint WorkProgress `` /Wizard/WorkProgress Retrieve project data, process activities and actors, build paths, and prepare...
entrypoint UpdateFinalJSONData POST /Wizard/UpdateFinalJSONData The method processes POST requests to update nodes data and returns a success...
entrypoint GetAgentData `` /Wizard/GetAgentData GetAgentData retrieves and processes project data, categorizes activities...
entrypoint Wizard_ProcessMapRejection GET /Wizard/Wizard_ProcessMapRejection Process valid pType to retrieve data, update statuses, save config, and return...
entrypoint Wizard_Salary GET /Wizard/Wizard_Salary Process input data, request salary predictions, update infrastructure costs...
entrypoint Wizard_DOE GET /Wizard/Wizard_DOE Wizard_DOE sends a POST request with valid parameters, processes successful...
entrypoint Wizard_Product GET /Wizard/Wizard_Product Wizard_Product processes valid pType input, retrieves and saves products...
entrypoint Wizard_DecisionPercentage GET /Wizard/Wizard_DecisionPercentage Processes valid pType to retrieve data, update model, save config, and return...
entrypoint Wizard_AHT GET /Wizard/Wizard_AHT Wizard_AHT processes valid input to update bulk AHT and handles POST request...
entrypoint Wizard_Deadline GET /Wizard/Wizard_Deadline Wizard_Deadline retrieves input, calls '/predict_deadline' API, processes...
entrypoint Wizard_Waittype GET /Wizard/Wizard_Waittype Process valid pType to retrieve data, call external API, handle activities and...
entrypoint Wizard_NVA GET /Wizard/Wizard_NVA Wizard_NVA processes valid pType requests, posts data to an external API...
entrypoint Wizard_Controls GET /Wizard/Wizard_Controls Retrieve input data, send it for risk assessment, process objectives with...

Other Methods

Type Method HTTP URL Summary
entrypoint DeadlinesGENAI POST /Wizard/DeadlinesGENAI The method decodes request data, sends it to GENAIURL with an empty API key...
entrypoint Wizard_Forms GET /Wizard/Wizard_Forms No key flows are defined for the Wizard_Forms method.

Associated Screens / Views

  • WorkProgressWorkProgress (Andromeda.Web\Views\Wizard\WorkProgress.cshtml)

Entrypoint Methods

WorkProgress

Summary: Retrieve project data, process activities and actors, build paths, and prepare view data or redirect accordingly.

ActionResult WizardController.WorkProgress()

Routing

  • URL: /Wizard/WorkProgress
View Metadata
  • View: WorkProgress (Andromeda.Web\Views\Wizard\WorkProgress.cshtml)
Detailed Analysis

Key Flows - and prepare view data or redirect accordingly. - Load base process map XML into ViewData - Redirect to DisplayProjects if condition met - Redirect to ProcessCreat if activities exist - Retrieve current project ID from Registry, Retrieve project process status and initialize activity-related lists, Retrieve and filter actors and arrows by activity type and predecessors, Construct MapPath objects using GetCompleteSucPath for filtered activities, Populate ViewData with activities, actors, arrows, parallel activities, paths, and project data

Error Flows - Summary: Redirect to 'DisplayProjects' action on specific error condition. - Redirect to 'DisplayProjects' action on error condition

Performance Issues - Summary: Avoid multiple enumerations and unnecessary list copying to improve performance. - Multiple enumerations from Count() inside Where() and loops, Unnecessary memory allocation from ToList() during filtering, Repeated iterations from Any() inside loops

Maintainability Issues - Summary: Unclear method naming, poor variable names, magic strings, tight coupling, and complex conditions reduce maintainability. - Unclear method name 'WorkProgress' causing confusion about redirection

UX Impact Notes - Summary: Conditional redirects alter user navigation and displayed data - Conditional redirect to 'DisplayProjects' page - Redirect to 'ProcessCreat' action when activities exist

Test Case Ideas - Summary: Verify method returns correct ActionResult - handles redirects - Redirect to DisplayProjects on true condition - Redirect behavior on false condition - Redirect to ProcessCreat when activities exist - Return ActionResult validation - GetProcessStatus returns correct status for project ID - Early return when no matching paths - ReadProjectXml called and returns expected data

Dependencies & Called Services - Summary: Uses collections and interfaces for managing actor, plan, process, and wizard models. - Enumerable for collection operations, IActorModel interface, ICollection interface, IFinalPlanModel interface, IProcessModel interface, IWizardModel interface, List collection, String type

GetActivityFromJson

Summary: Parse JSON array to create and populate ActivityTemplate objects with properties and successor arrows.

List<ActivityTemplate> WizardController.GetActivityFromJson(string jsonData)

Routing

  • URL: /Wizard/GetActivityFromJson
Detailed Analysis

Key Flows - Summary: Parse JSON array to create and populate ActivityTemplate objects with properties and successor arrows. - Iterate JSON nodes to create ActivityTemplate instances - Assign properties from JSON

Error Flows - Summary: Handle JSON decoding and data conversion errors to prevent runtime failures. - Incomplete or malformed code causing potential errors, Lack of exception handling for JSON decoding, No error handling for data conversion operations

Security Issues - Summary: Incomplete code risks unexpected behavior and potential security flaws. - Incomplete code risks unexpected behavior, Potential hidden security flaws due to incomplete implementation

Performance Issues - Summary: Repeated conversions and large collection iterations degrade JSON data processing performance. - Repeated Convert.ToString and Convert.ToDouble calls without error handling, Inefficient iteration over large successor collections in JSON data

Maintainability Issues - Summary: Replace magic strings with constants and provide complete, clear code for maintainability. - Use constants or enums instead of magic strings for JSON property names, Avoid incomplete or unclear code fragments, Provide complete variable declarations and statements

Test Case Ideas - conditional logic - Create and populate 'SucArrows' list - Assign values based on 'a.AHT' conditions - Ensure method returns expected results under normal conditions - Handle empty JSON input gracefully

Dependencies & Called Services - Summary: Convert ICollection to List for easier manipulation. - ICollection conversion, List creation

CheckEnrichStatus

Summary: Construct JSON payload, send request, and return JSON response based on HTTP status.

JsonResult WizardController.CheckEnrichStatus()

Routing

  • HTTP: GET
  • URL: /Wizard/CheckEnrichStatus

Cross-layer call chain - WizardController.CheckEnrichStatus → Andromeda.Core.LoggingManager.Info

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    WizardController_CheckEnrichStatus["WizardController.CheckEnrichStatus"]
    WizardController_CheckEnrichStatus --> Andromeda_Core_LoggingManager_Info
Detailed Analysis

Key Flows - send request - and return JSON response based on HTTP status. - Check if HTTP response status is OK - Return response content as JSON if OK - Return JSON with false if response not OK

Error Flows - Summary: Handle non-OK HTTP status by returning false and address potential blocking and typo issues. - Return JSON false on non-OK HTTP status - Fix typo in status code check

Security Issues - Summary: The X-API-Key header uses an empty string, risking inadequate authentication. - Empty X-API-Key header value, Inadequate authentication due to empty API key

Performance Issues - Summary: Avoid blocking calls on async methods to prevent thread blocking and delays. - Blocking calls on async methods, Thread blocking causing delayed responses

Maintainability Issues - Summary: Hardcoded settings and incorrect status code checks reduce maintainability. - Hardcoded URL and instance name in settings

UX Impact Notes - Summary: Returning false JSON and blocking calls degrade user experience and responsiveness. - Boolean false JSON response disrupts UI updates and user flow

Test Case Ideas - Summary: Verify endpoint response handling, request payload correctness, and HTTP method configuration. - Handle various HTTP status codes for proper branching - Handle empty or malformed response content - Ensure project ID and instance name usage from app settings in payload - Return JSON false when response status is not OK - Validate successful response and correct JSON content

Dependencies & Called Services - Summary: Uses logging - LoggingManager for logging - Task for asynchronous operations, TimeSpan for time measurement

UpdateFinalJSONData

Summary: The method processes POST requests to update nodes data and returns a success JSON response.

JsonResult WizardController.UpdateFinalJSONData()

Routing

  • HTTP: POST
  • URL: /Wizard/UpdateFinalJSONData

Cross-layer call chain - WizardController.UpdateFinalJSONData → Andromeda.Core.DataManager.Execute - Andromeda.Core.DataManager.Execute → Andromeda.Core.LoggingManager.Debug - Andromeda.Core.DataManager.Execute → Andromeda.Core.Database.helper.SqlParameters

Call Chain Diagram

flowchart TD
    Andromeda_Core_DataManager_Execute["Andromeda.Core.DataManager.Execute"]
    Andromeda_Core_Database_helper_SqlParameters["Andromeda.Core.Database.helper.SqlParameters"]
    Andromeda_Core_LoggingManager_Debug["Andromeda.Core.LoggingManager.Debug"]
    WizardController_UpdateFinalJSONData["WizardController.UpdateFinalJSONData"]
    Andromeda_Core_DataManager_Execute --> Andromeda_Core_Database_helper_SqlParameters
    Andromeda_Core_DataManager_Execute --> Andromeda_Core_LoggingManager_Debug
    WizardController_UpdateFinalJSONData --> Andromeda_Core_DataManager_Execute
Detailed Analysis

Key Flows - Summary: The method processes POST requests to update nodes data and returns a success JSON response. - Call WizardModel.UpdateFinalJSONData with project ID and nodes data - Return JSON response confirming successful update

Security Issues - Summary: Directly converting Request.Form['nodes'] to string risks security vulnerabilities. - Lack of validation for Request.Form['nodes'], No sanitization of Request.Form['nodes'] input

Maintainability Issues - Summary: Duplicate method name 'UpdateFinalJSONData' reduces code maintainability. - Duplicate method name in controller and WizardModel, Potential confusion from method name reuse

Test Case Ideas - Summary: Verify UpdateFinalJSONData processes POST requests - and returns success JSON. - Invoke UpdateFinalJSONData on HTTP POST - Call WizardModel.UpdateFinalJSONData with correct project ID and nodes - Return JSON result indicating success

Dependencies & Called Services - Summary: Convert IWizardModel to update final JSON data. - Convert IWizardModel

DownloadWizardInputJson

Summary: DownloadWizardInputJson retrieves project ID, fetches project details, obtains JSON content, and returns it as a downloadable file.

FileContentResult WizardController.DownloadWizardInputJson()

Routing

  • HTTP: GET
  • URL: /Wizard/DownloadWizardInputJson
Detailed Analysis

Key Flows - and returns it as a downloadable file. - Fetch project details - Return JSON as downloadable file with correct content type and filename

Error Flows - Summary: Return empty file if project details or JSON content are null or whitespace. - Return empty file

Performance Issues - Summary: No performance issues identified in DownloadWizardInputJson method.

Maintainability Issues - Summary: Method name lacks clarity about returning a .js file. - Unclear method name regarding .js file return

UX Impact Notes - Summary: Downloading uploaded JSON may disrupt user experience if file is large or unexpected. - File download of uploaded JSON content, Potential UX disruption from large file size, Unexpected file download impacts user experience

Test Case Ideas - Summary: Verify HTTP GET response and correct JSON file content based on project data. - Handle HTTP GET requests correctly - Return JSON file with project-uploaded content - Return empty file if no project JSON uploaded

Dependencies & Called Services - Summary: Uses encoding and wizard model interfaces for string data processing. - Encoding service, IWizardModel interface, String data handling

DownloadWizardFinalJson

Summary: DownloadWizardFinalJson retrieves project ID and status, encodes final JSON, and returns it as a downloadable file.

FileContentResult WizardController.DownloadWizardFinalJson()

Routing

  • HTTP: GET
  • URL: /Wizard/DownloadWizardFinalJson
Detailed Analysis

Key Flows - and returns it as a downloadable file. - Return downloadable JSON file

Error Flows - Summary: Return empty file if project status retrieval fails or is null. - Graceful return of empty file on failure or null status

Performance Issues - Summary: Using string.IsNullOrWhiteSpace on large JSON strings degrades performance. - Inefficient use of string.IsNullOrWhiteSpace on large JSON content

Maintainability Issues - Summary: Rename method to clearly indicate it returns a file for better maintainability. - Unclear method name about returning a file

UX Impact Notes - Summary: Users download final JSON file or receive an unexpected empty file. - Initiate file download with final JSON content, Deliver empty file if final JSON content is missing

Test Case Ideas - Summary: Verify HTTP GET response and correct JSON file return when final JSON exists. - Handle HTTP GET requests correctly - Return file with correct JSON content if final JSON exists

Dependencies & Called Services - Summary: Uses encoding and wizard model interfaces with string data types. - Encoding dependency, IWizardModel interface, String data type

ProductPredictions

Summary: Decode request JSON, send it via POST to the product predictions API, and return the successful JSON response.

JsonResult WizardController.ProductPredictions()

Routing

  • HTTP: POST
  • URL: /Wizard/ProductPredictions

Cross-layer call chain - WizardController.ProductPredictions → Andromeda.Core.LoggingManager.Info - WizardController.ProductPredictions → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    WizardController_ProductPredictions["WizardController.ProductPredictions"]
    WizardController_ProductPredictions --> Andromeda_Core_LoggingManager_Error
    WizardController_ProductPredictions --> Andromeda_Core_LoggingManager_Info
Detailed Analysis

Key Flows - send it via POST to the product predictions API - and return the successful JSON response. - Send POST request to /predictions/product endpoint - Log success and return JSON response content

Error Flows - Summary: Log errors and return failure response on unsuccessful API status. - Log error on unsuccessful API response - Return JSON response with false indicating failure

Security Issues - Summary: API key exposure risks due to plain text storage and transmission. - API key stored in web configuration in plain text, API key added to request headers without encryption

Performance Issues - Summary: Reuse HttpClient and avoid blocking calls to improve performance and scalability. - HttpClient recreated per request causing socket exhaustion

Maintainability Issues - Summary: Tight coupling and unclear code reduce maintainability and flexibility. - Use of magic string in log messages reduces clarity and flexibility

UX Impact Notes - Summary: Incomplete code and false JSON responses degrade user experience and error clarity. - Incomplete code causes unexpected behavior and errors, Boolean false JSON responses reduce error handling clarity

Test Case Ideas - Summary: Verify endpoint success, API key inclusion, correct JSON response, and 'llowGet' variable behavior. - Endpoint returns success on valid data - Method returns correct JSON based on API status - Validate 'llowGet' variable value and effect

Dependencies & Called Services - Summary: Uses logging - Asynchronous task handling, Time interval management - Logging management

FormsPredictions

Summary: Decode JSON request, send it via HTTP POST to the prediction endpoint, and return the JSON response on success.

JsonResult WizardController.FormsPredictions()

Routing

  • HTTP: POST
  • URL: /Wizard/FormsPredictions

Cross-layer call chain - WizardController.FormsPredictions → Andromeda.Core.LoggingManager.Info - WizardController.FormsPredictions → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    WizardController_FormsPredictions["WizardController.FormsPredictions"]
    WizardController_FormsPredictions --> Andromeda_Core_LoggingManager_Error
    WizardController_FormsPredictions --> Andromeda_Core_LoggingManager_Info
Detailed Analysis

Key Flows - send it via HTTP POST to the prediction endpoint - and return the JSON response on success. - Create HTTP client with base address and API key header - Send POST request to '/predictions/forms_modes' with JSON data - Log info and return JSON response if status is 200 OK

Error Flows - Summary: Handle non-200 responses by logging errors and returning JSON false for prediction failures. - Log error on non-HTTP 200 response - Return JSON false on prediction API failure

Security Issues - Summary: Storing API key in WebConfigurationManager.AppSettings risks key exposure. - API key exposure via WebConfigurationManager.AppSettings storage

Performance Issues - Summary: Avoid creating HttpClient per call and synchronous blocking on async operations to improve performance. - HttpClient instance created per method call causing socket exhaustion

Maintainability Issues - Summary: Magic strings and unclear code fragments reduce clarity and maintainability. - Use of magic strings for API endpoints and HTTP headers, Unclear and incomplete code fragments reducing readability, Ambiguous use of 'System.Net' without context

UX Impact Notes - Summary: Returning JSON false triggers user error messages; error logging aids diagnosis without user feedback. - Returning JSON false triggers user-facing error messages or validation feedback - Error logging supports issue diagnosis without direct user feedback

Test Case Ideas - Summary: Verify JSON decoding, API response handling, and 'llowGet' variable effects. - Send data to predictions endpoint - Handle various HTTP status codes including success and errors

Dependencies & Called Services - Summary: Uses logging - LoggingManager for logging - Task for asynchronous operations, TimeSpan for time intervals

BusinessRulesPredictions

Summary: Decode request JSON, send synchronous POST to external API, log and return successful response JSON.

JsonResult WizardController.BusinessRulesPredictions()

Routing

  • HTTP: POST
  • URL: /Wizard/BusinessRulesPredictions

Cross-layer call chain - WizardController.BusinessRulesPredictions → Andromeda.Core.LoggingManager.Info - WizardController.BusinessRulesPredictions → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    WizardController_BusinessRulesPredictions["WizardController.BusinessRulesPredictions"]
    WizardController_BusinessRulesPredictions --> Andromeda_Core_LoggingManager_Error
    WizardController_BusinessRulesPredictions --> Andromeda_Core_LoggingManager_Info
Detailed Analysis

Key Flows - send synchronous POST to external API - log and return successful response JSON. - Send synchronous POST request to external API - Log success and return response JSON on success

Error Flows - Summary: Log errors and return false on API failure; handle API delays and timeouts. - Handle API response delays and potential timeouts - Log error and return JSON false on unsuccessful API response

Security Issues - Summary: No security issues identified in BusinessRulesPredictions method.

Performance Issues - Summary: Reuse HttpClient and avoid synchronous blocking calls to improve performance. - Avoid synchronous blocking calls when waiting for response and reading content - Create HttpClient once and reuse to prevent socket exhaustion

Maintainability Issues - Summary: Store API config externally and avoid magic strings to improve code clarity and maintainability. - API URL and key stored in app settings complicate environment management

UX Impact Notes - Summary: Returning false on failure harms UX; error logging aids diagnosis but lacks user feedback. - Returning false in JSON response on failure - Error logging without direct user feedback

Test Case Ideas - Summary: Verify JSON decoding, API key header, timeout handling, error management, and response parsing. - Return API response as JSON on success - Gracefully handle POST request errors - Handle API response timeouts

Dependencies & Called Services - Summary: Uses logging - LoggingManager for logging - Task for asynchronous operations, TimeSpan for time intervals

AHTPredictions

Summary: Decode JSON request, send POST to external API with API key, return successful response JSON.

JsonResult WizardController.AHTPredictions()

Routing

  • HTTP: POST
  • URL: /Wizard/AHTPredictions

Cross-layer call chain - WizardController.AHTPredictions → Andromeda.Core.LoggingManager.Info - WizardController.AHTPredictions → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    WizardController_AHTPredictions["WizardController.AHTPredictions"]
    WizardController_AHTPredictions --> Andromeda_Core_LoggingManager_Error
    WizardController_AHTPredictions --> Andromeda_Core_LoggingManager_Info
Detailed Analysis

Key Flows - send POST to external API with API key - return successful response JSON. - Send POST request to external API with API key header - Return API response content as JSON - Log info on success

Error Flows - Summary: Log error and return false JSON on unsuccessful API response. - Log error on API failure - Return JSON response with false value

Security Issues - Summary: API key exposure risk through app settings compromises security. - API key exposure via 'MIAPIKey' app setting

Performance Issues - Summary: HttpClient misuse and blocking calls degrade performance and risk resource exhaustion. - Undisposed HttpClient instance risks socket exhaustion, Blocking calls on response.Wait() and ReadAsStringAsync().Result degrade performance

Maintainability Issues - Summary: Store API credentials securely and avoid hardcoded strings to improve maintainability. - Insecure storage of API URL and key in app settings

UX Impact Notes - Summary: Return JSON false on error to clearly inform users of failure. - Return JSON false on error

Test Case Ideas - error logging - Send correct data to external API - Return JSON false for unexpected status codes - Verify 'llowGet' value after assignment - Handle various HTTP status codes - Handle empty response content - Log errors for different API statuses

Dependencies & Called Services - Summary: Uses logging - LoggingManager for logging - Task for asynchronous operations, TimeSpan for time intervals

ControlsPredictions

Summary: Decode JSON from POST request, send it to external API synchronously, log success, and return JSON response on HTTP 200.

JsonResult WizardController.ControlsPredictions()

Routing

  • HTTP: POST
  • URL: /Wizard/ControlsPredictions

Cross-layer call chain - WizardController.ControlsPredictions → Andromeda.Core.LoggingManager.Info - WizardController.ControlsPredictions → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    WizardController_ControlsPredictions["WizardController.ControlsPredictions"]
    WizardController_ControlsPredictions --> Andromeda_Core_LoggingManager_Error
    WizardController_ControlsPredictions --> Andromeda_Core_LoggingManager_Info
Detailed Analysis

Key Flows - send it to external API synchronously - log success - and return JSON response on HTTP 200. - Send POST request with decoded data to external API using HttpClient - Log success and return JSON response if status is HTTP 200 OK

Error Flows - Summary: Log error and return failure JSON if API response is not HTTP 200 OK. - Log error with status code on non-200 response - Return JSON response with false value indicating failure

Security Issues - Summary: API key exposure risk through app settings compromises security. - API key exposure via 'MIAPIKey' app setting

Performance Issues - Summary: HttpClient misuse and blocking calls reduce scalability and cause resource exhaustion. - Undisposed HttpClient instance causing socket exhaustion, Blocking call on response.Wait() causing thread blocking, Blocking call on ReadAsStringAsync().Result causing thread blocking

Maintainability Issues - Summary: Hardcoded settings and unclear code reduce maintainability and increase error risk. - Hardcoded app settings 'MIAPIURL' and 'MIAPIKey' hinder configuration changes

UX Impact Notes - Summary: Error logging aids diagnosis but lacks direct user feedback. - Error logging for issue diagnosis

Test Case Ideas - Summary: Verify JSON decoding, API request correctness, error handling, response status, and timeout behavior. - Send correct data to external API - Return JSON false on unsuccessful API response - Verify 'llowGet' variable assignment and effect - Handle missing or invalid API key errors - Handle various HTTP status codes from API - Handle response.Wait() timeout or indefinite blocking

Dependencies & Called Services - Summary: Uses logging - LoggingManager for logging - Task for asynchronous operations, TimeSpan for time intervals

ProcessMaprejectionGENAI

Summary: Synchronously wait for API response, verify success, log it, and return JSON content.

JsonResult WizardController.ProcessMaprejectionGENAI()

Routing

  • HTTP: POST
  • URL: /Wizard/ProcessMaprejectionGENAI

Cross-layer call chain - WizardController.ProcessMaprejectionGENAI → Andromeda.Core.LoggingManager.Info - WizardController.ProcessMaprejectionGENAI → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    WizardController_ProcessMaprejectionGENAI["WizardController.ProcessMaprejectionGENAI"]
    WizardController_ProcessMaprejectionGENAI --> Andromeda_Core_LoggingManager_Error
    WizardController_ProcessMaprejectionGENAI --> Andromeda_Core_LoggingManager_Info
Detailed Analysis

Key Flows - and return JSON content. - Check if status code is OK - Log successful API call - Return response as JSON

Error Flows - Summary: Log errors and return false JSON on non-OK response status. - Log error on non-OK response status - Return JSON response with false value on failure

Security Issues - Summary: Adding an empty X-API-Key header compromises security. - Empty X-API-Key header value, Potential unauthorized access risk

Performance Issues - Summary: The method blocks execution with synchronous calls, degrading performance. - Blocking calls with response.Wait(), Synchronous reading via ReadAsStringAsync().Result

Maintainability Issues - Summary: Hardcoded URLs and unclear code reduce maintainability and increase error risk. - Hardcoded API URL in WebConfigurationManager, Use of magic strings and enums reduces code clarity, Incomplete and unclear code lines cause compilation errors

UX Impact Notes - Summary: The method provides minimal direct user feedback and indicates failure via JSON false. - Error logging aids diagnosis without user notification - JSON false return signals operation failure to user

Test Case Ideas - Summary: Validate API request handling - response status checks - error logging - and return values. - Handle non-OK HTTP status codes - Log errors for validation failures - Send API request with valid data - Return false on error status codes - Return correct JSON response

Dependencies & Called Services - Summary: Uses logging - LoggingManager for logging - Task for asynchronous operations, TimeSpan for time intervals

DeadlinesGENAI

Summary: The method decodes request data, sends it to GENAIURL with an empty API key, logs successful responses, and returns JSON content.

JsonResult WizardController.DeadlinesGENAI()

Routing

  • HTTP: POST
  • URL: /Wizard/DeadlinesGENAI

Cross-layer call chain - WizardController.DeadlinesGENAI → Andromeda.Core.LoggingManager.Info - WizardController.DeadlinesGENAI → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    WizardController_DeadlinesGENAI["WizardController.DeadlinesGENAI"]
    WizardController_DeadlinesGENAI --> Andromeda_Core_LoggingManager_Error
    WizardController_DeadlinesGENAI --> Andromeda_Core_LoggingManager_Info
Detailed Analysis

Key Flows - sends it to GENAIURL with an empty API key - logs successful responses - and returns JSON content. - Send data to GENAIURL endpoint with empty X-API-Key header - Return response content as JSON - Log status if response is OK

Error Flows - Summary: Log error and return failure JSON on non-OK response status. - Log error with status code - Return JSON result with false boolean

Security Issues - Summary: Setting X-API-Key header to empty string causes unauthorized access risk. - Empty X-API-Key header, Unauthorized access vulnerability

Performance Issues - Summary: The method blocks threads using synchronous calls, degrading performance. - Blocking calls with response.Wait(), Synchronous call ReadAsStringAsync().Result causing thread blocking

Maintainability Issues - Summary: Improve code clarity by removing magic strings, fixing incomplete code, and enhancing naming. - Store GENAIURL in a configurable, manageable location, Avoid magic strings and hardcoded enum values, Fix incomplete and unclear code snippets to prevent compilation errors, Use descriptive method names for better readability

UX Impact Notes - Summary: The method returns JSON results affecting UX based on response handling and lacks user-facing error messages. - Return JSON results based on response status - Error logging supports troubleshooting

Test Case Ideas - error logging - Send request to correct endpoint URL - Wait for response and check status code - Read and return response content as JSON - Set X-API-Key header and test empty key security - Handle incomplete code without runtime errors - Log errors on non-OK response status

Dependencies & Called Services - Summary: Uses LoggingManager for logs - LoggingManager for logging - Task for asynchronous operations, TimeSpan for time intervals

GetChatbotAnswer

Summary: Build API URL, verify response success, deserialize and return JSON content.

Task<JsonResult> WizardController.GetChatbotAnswer(string question, string uniqueId, string screen)

Routing

  • HTTP: GET
  • URL: /Wizard/GetChatbotAnswer
Detailed Analysis

Key Flows - deserialize and return JSON content. - Deserialize and return JSON content

Error Flows - Summary: Return JSON error response if chatbot API call fails. - Check API response success - Return JSON with success false and error message on failure

Security Issues - Summary: Deserializing response content without strong typing or sanitization risks JSON injection. - JSON deserialization vulnerability, Lack of strong typing in deserialization, Missing input sanitization on response content

Performance Issues - Summary: Reading entire response content into memory degrades performance with large data. - Reading entire response content into memory, Performance degradation with large responses

Maintainability Issues - Summary: Fix typos, avoid hardcoded messages, and use strong typing for JSON deserialization. - Typo in response property name 'IsSucces' instead of 'IsSuccess', Hardcoded error message limits debugging and localization, Use of JsonConvert.DeserializeObject without strong typing reduces maintainability

UX Impact Notes - Summary: Handle chatbot API errors gracefully to improve user experience. - Early return on unsuccessful response impacts user experience

Test Case Ideas - Summary: Test API response handling for success, error, and conditional status codes. - Successful API response deserialization and JSON return - Unsuccessful API response early return with error message

Dependencies & Called Services - Summary: Uses TimeSpan for timing and Uri for resource identification. - TimeSpan for timing operations, Uri for resource identification

GetAgentData

Summary: GetAgentData retrieves and processes project data, categorizes activities, determines automation types, calculates risk and control metrics, and analyzes schedules for critical paths and cycle times.

Object WizardController.GetAgentData(string type)

Routing

  • URL: /Wizard/GetAgentData

Cross-layer call chain - WizardController.GetAgentData → Andromeda.Core.Entities.Arrow.Clone - WizardController.GetAgentData → Andromeda.Core.Services.ProcessExtensions.FindByID - WizardController.GetAgentData → Andromeda.Core.Extensions.LinqExtensions.getSkillScore - WizardController.GetAgentData → Andromeda.Core.Entities.Activity.ReworkEffort - WizardController.GetAgentData → Andromeda.Core.Entities.Activity.TotalEffort - WizardController.GetAgentData → Andromeda.Core.Entities.Activity.GetNVAType - WizardController.GetAgentData → Insorce.Helpers.Helpers.GetIndividualPath - WizardController.GetAgentData → Andromeda.Core.Entities.Actor.WorkStartTimeInProjectZone - WizardController.GetAgentData → Andromeda.Core.Entities.Actor.WorkEndTimeInProjectZone - WizardController.GetAgentData → Andromeda.Core.Entities.Actor.GetLocation - WizardController.GetAgentData → Andromeda.Core.Extensions.LinqExtensions.RemoveInvalidFileNameChars - WizardController.GetAgentData → Andromeda.Core.Services.ExcelGenerator.CloneRow - WizardController.GetAgentData → Andromeda.Core.Services.ExcelGenerator.UpdateCell - Insorce.Helpers.Helpers.GetIndividualPath → Andromeda.Core.Entities.Arrow.Clone - Insorce.Helpers.Helpers.GetIndividualPath → Andromeda.Core.Entities.EdgeInfo.Clone - Andromeda.Core.Entities.Actor.GetLocation → Andromeda.Core.DataManager.GetData

Call Chain Diagram

flowchart TD
    Andromeda_Core_DataManager_GetData["Andromeda.Core.DataManager.GetData"]
    Andromeda_Core_Entities_Activity_GetNVAType["Andromeda.Core.Entities.Activity.GetNVAType"]
    Andromeda_Core_Entities_Activity_ReworkEffort["Andromeda.Core.Entities.Activity.ReworkEffort"]
    Andromeda_Core_Entities_Activity_TotalEffort["Andromeda.Core.Entities.Activity.TotalEffort"]
    Andromeda_Core_Entities_Actor_GetLocation["Andromeda.Core.Entities.Actor.GetLocation"]
    Andromeda_Core_Entities_Actor_WorkEndTimeInProjectZone["Andromeda.Core.Entities.Actor.WorkEndTimeInProjectZone"]
    Andromeda_Core_Entities_Actor_WorkStartTimeInProjectZone["Andromeda.Core.Entities.Actor.WorkStartTimeInProjectZone"]
    Andromeda_Core_Entities_Arrow_Clone["Andromeda.Core.Entities.Arrow.Clone"]
    Andromeda_Core_Entities_EdgeInfo_Clone["Andromeda.Core.Entities.EdgeInfo.Clone"]
    Andromeda_Core_Extensions_LinqExtensions_RemoveInvalidFileNameChars["Andromeda.Core.Extensions.LinqExtensions.RemoveInvalidFileNameChars"]
    Andromeda_Core_Extensions_LinqExtensions_getSkillScore["Andromeda.Core.Extensions.LinqExtensions.getSkillScore"]
    Andromeda_Core_Services_ExcelGenerator_CloneRow["Andromeda.Core.Services.ExcelGenerator.CloneRow"]
    Andromeda_Core_Services_ExcelGenerator_UpdateCell["Andromeda.Core.Services.ExcelGenerator.UpdateCell"]
    Andromeda_Core_Services_ProcessExtensions_FindByID["Andromeda.Core.Services.ProcessExtensions.FindByID"]
    Insorce_Helpers_Helpers_GetIndividualPath["Insorce.Helpers.Helpers.GetIndividualPath"]
    WizardController_GetAgentData["WizardController.GetAgentData"]
    Andromeda_Core_Entities_Actor_GetLocation --> Andromeda_Core_DataManager_GetData
    Insorce_Helpers_Helpers_GetIndividualPath --> Andromeda_Core_Entities_Arrow_Clone
    Insorce_Helpers_Helpers_GetIndividualPath --> Andromeda_Core_Entities_EdgeInfo_Clone
    WizardController_GetAgentData --> Andromeda_Core_Entities_Activity_GetNVAType
    WizardController_GetAgentData --> Andromeda_Core_Entities_Activity_ReworkEffort
    WizardController_GetAgentData --> Andromeda_Core_Entities_Activity_TotalEffort
    WizardController_GetAgentData --> Andromeda_Core_Entities_Actor_GetLocation
    WizardController_GetAgentData --> Andromeda_Core_Entities_Actor_WorkEndTimeInProjectZone
    WizardController_GetAgentData --> Andromeda_Core_Entities_Actor_WorkStartTimeInProjectZone
    WizardController_GetAgentData --> Andromeda_Core_Entities_Arrow_Clone
    WizardController_GetAgentData --> Andromeda_Core_Extensions_LinqExtensions_RemoveInvalidFileNameChars
    WizardController_GetAgentData --> Andromeda_Core_Extensions_LinqExtensions_getSkillScore
    WizardController_GetAgentData --> Andromeda_Core_Services_ExcelGenerator_CloneRow
    WizardController_GetAgentData --> Andromeda_Core_Services_ExcelGenerator_UpdateCell
    WizardController_GetAgentData --> Andromeda_Core_Services_ProcessExtensions_FindByID
    WizardController_GetAgentData --> Insorce_Helpers_Helpers_GetIndividualPath
Detailed Analysis

Key Flows - Summary: GetAgentData retrieves and processes project data, categorizes activities, determines automation types, calculates risk and control metrics, and analyzes schedules for critical paths and cycle times. - Load legacy systems conditionally based on configuration - Determine automation types and assign labels per business rules

Error Flows - Summary: Handle null references and add explicit exception handling to prevent runtime errors. - Null reference exceptions from ActProps, BusinessRules, or productFactors, Incomplete code causing compilation errors or unexpected behavior, Lack of explicit exception handling for data retrieval and processing errors

Security Issues - Summary: GetAgentData risks SQL injection due to missing input validation and security checks. - Absence of security checks

Performance Issues - Summary: Excessive database queries, repeated method calls, and inefficient LINQ usage degrade performance. - Multiple database queries on large datasets

Maintainability Issues - Summary: The method's complexity, unclear variables, and magic values reduce maintainability and readability. - Excessive method length and complexity with many variables and nested LINQ queries, Extensive use of anonymous types obscures data structures and complicates debugging, Use of magic strings and numbers reduces code readability, Non-descriptive variable names decrease code clarity, Incomplete and truncated code segments hinder understanding and cause compilation issues

UX Impact Notes - Summary: Supports UI components by providing aggregated project, schedule, and risk data. - Aggregated data for project information, Aggregated data for schedule information, Aggregated data for risk information

Test Case Ideas - Summary: Verify data retrieval, processing, calculations, and performance under diverse scenarios. - Automation type calculation and label assignment per business rules

Dependencies & Called Services - Summary: Uses data models, collections, and utility helpers for processing agent data. - Activity, Actor, Arrow, Convert, DateTime, Enumerable, Helpers, IActorModel, IControlModel, IFinalPlanModel, IInfraModel, IProcessModel, IRiskModel, Int32, LinqExtensions, List, Math, String - ProcessExtensions

GetAgentJsonData

Summary: GetAgentJsonData retrieves and returns agent data in JSON format.

JsonResult WizardController.GetAgentJsonData(string type)

Routing

  • HTTP: GET
  • URL: /Wizard/GetAgentJsonData

Cross-layer call chain - WizardController.GetAgentJsonData → System.Web.Mvc.LargeJsonResult.JsonEncode

Call Chain Diagram

flowchart TD
    System_Web_Mvc_LargeJsonResult_JsonEncode["System.Web.Mvc.LargeJsonResult.JsonEncode"]
    WizardController_GetAgentJsonData["WizardController.GetAgentJsonData"]
    WizardController_GetAgentJsonData --> System_Web_Mvc_LargeJsonResult_JsonEncode
Detailed Analysis

Key Flows - Summary: GetAgentJsonData retrieves and returns agent data in JSON format. - Return JSON response

Maintainability Issues - Summary: Replace magic string 'Peak' with a named constant to improve maintainability. - Use named constant instead of magic string 'Peak'

Test Case Ideas - Summary: Verify GetAgentJsonData handles HTTP GET requests and returns correct JSON data based on 'type' parameter. - Handle HTTP GET requests - Return JSON object - Return correct agent data for valid 'type' parameter

Dependencies & Called Services - Summary: Uses LargeJsonResult and String types within the Wizard service. - LargeJsonResult dependency, String type usage, Wizard service integration

GetAll_Diagnoses

Summary: GetAll_Diagnoses returns existing diagnosis data from WizardModel as JSON if Refresh is false or missing.

JsonResult WizardController.GetAll_Diagnoses(bool? Refresh)

Routing

  • HTTP: GET
  • URL: /Wizard/GetAll_Diagnoses

Cross-layer call chain - WizardController.GetAll_Diagnoses → System.Web.Mvc.LargeJsonResult.JsonEncode - WizardController.GetAll_Diagnoses → Andromeda.Core.LoggingManager.Info - WizardController.GetAll_Diagnoses → Andromeda.Core.LoggingManager.Exception - WizardController.GetAll_Diagnoses → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Exception["Andromeda.Core.LoggingManager.Exception"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    System_Web_Mvc_LargeJsonResult_JsonEncode["System.Web.Mvc.LargeJsonResult.JsonEncode"]
    WizardController_GetAll_Diagnoses["WizardController.GetAll_Diagnoses"]
    WizardController_GetAll_Diagnoses --> Andromeda_Core_LoggingManager_Error
    WizardController_GetAll_Diagnoses --> Andromeda_Core_LoggingManager_Exception
    WizardController_GetAll_Diagnoses --> Andromeda_Core_LoggingManager_Info
    WizardController_GetAll_Diagnoses --> System_Web_Mvc_LargeJsonResult_JsonEncode
Detailed Analysis

Key Flows - Summary: GetAll_Diagnoses returns existing diagnosis data from WizardModel as JSON if Refresh is false or missing. - Check Refresh flag - Return valid data as JSON

Error Flows - Summary: Handle HTTP errors and exceptions with logging and return incomplete JSON response. - Catch and log exceptions using LoggingManager.Exception - Return incomplete JSON response on exceptions - Log error on HTTP POST failure or non-OK status

Security Issues - Summary: The method insecurely handles API keys and unvalidated JSON responses. - Use of empty X-API-Key header weakens authentication, Decoding JSON response without validation risks processing malicious data

Performance Issues - Summary: HttpClient misuse and synchronous blocking degrade performance. - HttpClient instance created per call without disposal causing socket exhaustion

Maintainability Issues - verbose assignments - repetitive assignments to DiagnosesData properties - HttpClient instance created inside method reducing testability

UX Impact Notes - Summary: Users receive diagnosis data or errors, but blocking calls and partial responses degrade experience. - JSON responses with diagnosis data or error messages, Synchronous blocking calls causing user delays, Incomplete JSON responses confusing users and clients

Test Case Ideas - JSON updates - Handle edge cases with empty/incomplete code blocks and partial JSON responses - Return JSON responses with correct JsonRequestBehavior - Update stored diagnosis data via WizardModel.UpdateDiagnosesJson - Validate GetAgentData output and JSON payload construction

Dependencies & Called Services - Summary: Uses wizard models, logging, asynchronous tasks, and large JSON results. - Logging management - Wizard model interface, Large JSON result handling, Asynchronous task management, Time span measurement, Wizard control

GetPeak_Diagnoses

Summary: Retrieve peak diagnostic data from the agent, update the diagnoses JSON, and return it as a JSON result.

JsonResult WizardController.GetPeak_Diagnoses()

Routing

  • HTTP: GET
  • URL: /Wizard/GetPeak_Diagnoses

Cross-layer call chain - WizardController.GetPeak_Diagnoses → System.Web.Mvc.LargeJsonResult.JsonEncode - WizardController.GetPeak_Diagnoses → Andromeda.Core.LoggingManager.Info - WizardController.GetPeak_Diagnoses → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    System_Web_Mvc_LargeJsonResult_JsonEncode["System.Web.Mvc.LargeJsonResult.JsonEncode"]
    WizardController_GetPeak_Diagnoses["WizardController.GetPeak_Diagnoses"]
    WizardController_GetPeak_Diagnoses --> Andromeda_Core_LoggingManager_Error
    WizardController_GetPeak_Diagnoses --> Andromeda_Core_LoggingManager_Info
    WizardController_GetPeak_Diagnoses --> System_Web_Mvc_LargeJsonResult_JsonEncode
Detailed Analysis

Key Flows - update the diagnoses JSON - and return it as a JSON result. - read response and update peak diagnoses JSON via WizardModel - Return updated data as JSON result

Error Flows - Summary: Log errors on non-OK API responses and handle incomplete code to prevent failures. - Address incomplete code and unknown method calls to avoid unexpected errors - Log error on non-OK API response with endpoint and status code

Security Issues - Summary: Fix API key exposure, content type misuse, blocking calls, and unknown method risks. - API key exposure from empty DefaultRequestHeaders, Incorrect 'text/plain' content type for PDF files, Denial-of-service risk from blocking ReadAsStringAsync().Result calls, Unknown security risks from unimplemented 'tes' method

Performance Issues - Summary: Dispose HttpClient properly and avoid synchronous blocking calls to improve performance. - Improper HttpClient disposal causing resource leaks, Synchronous blocking calls blocking threads and degrading performance

Maintainability Issues - Summary: Remove hardcoded values and clarify incomplete code to improve maintainability. - Fixed 60-minute timeout instead of configurable setting - Magic strings in logging should be constants for readability

UX Impact Notes - Summary: Blocking calls and long timeouts degrade frontend responsiveness. - Blocking calls, Long timeouts, Slower frontend responses

Test Case Ideas - Summary: Test GetPeak_Diagnoses for valid data, error handling, performance, and response correctness. - Handling unsuccessful HTTP responses with error logging

Dependencies & Called Services - Summary: Uses encoding, collections, logging, asynchronous tasks, and wizard-related models. - Encoding utilities, Enumerable collections, Wizard model interfaces, Large JSON result handling, String operations, Asynchronous task handling, TimeSpan for time intervals, Wizard process management - Logging management

GetCX_Summary_Diagnoses

Summary: Retrieve, decode, and serialize diagnoses data, post it to an endpoint, update the Wizard and Model, then return a JSON result.

JsonResult WizardController.GetCX_Summary_Diagnoses()

Routing

  • HTTP: GET
  • URL: /Wizard/GetCX_Summary_Diagnoses

Cross-layer call chain - WizardController.GetCX_Summary_Diagnoses → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    WizardController_GetCX_Summary_Diagnoses["WizardController.GetCX_Summary_Diagnoses"]
    WizardController_GetCX_Summary_Diagnoses --> Andromeda_Core_LoggingManager_Error
Detailed Analysis

Key Flows - update the Wizard and Model - then return a JSON result. - Return JSON result - Update Wizard with response content - Update Model's CX property

Error Flows - Summary: Log API failure error if HTTP response status is not OK. - Check HTTP response status code - Log API failure error using LoggingManager

Security Issues - Summary: HttpClient sends empty X-API-Key header risking unauthorized access. - Empty X-API-Key header in HttpClient request, Risk of unauthorized access due to missing API key

Performance Issues - Summary: Blocking ReadAsStringAsync().Result causes performance bottlenecks under high latency or large responses. - Blocking call to ReadAsStringAsync().Result, Potential performance bottlenecks with large responses or high network latency

Maintainability Issues - Summary: Incomplete code and magic strings reduce readability and maintainability. - Error logging uses magic string for error message

UX Impact Notes - Summary: Returning false JSON on null data and logging API errors impact user workflow and debugging. - Log API failure errors for debugging and user visibility - Return false JSON on null diagnoseData affects user workflow

Test Case Ideas - Summary: Verify GetCX_Summary_Diagnoses handles HTTP responses - updates models - Check Model.UpdateCX updates correctly after method call - Confirm HTTP POST request sends successfully and endpoint responds correctly - Ensure UpdateCX_SummaryJson is called with correct content on OK status - Verify error logging and behavior on non-OK HTTP status - Validate GetDiagnosesData returns expected data - Validate method returns appropriate JSON for different input scenarios

Dependencies & Called Services - LoggingManager for logs - IWizardModel for workflow management, Task for asynchronous operations, TimeSpan for time measurement - LoggingManager for logging

GetNVA_solution

Summary: Retrieve agent data, send it via POST to the diagnostics endpoint, and return the JSON response on success.

JsonResult WizardController.GetNVA_solution()

Routing

  • HTTP: GET
  • URL: /Wizard/GetNVA_solution

Cross-layer call chain - WizardController.GetNVA_solution → System.Web.Mvc.LargeJsonResult.JsonEncode - WizardController.GetNVA_solution → Andromeda.Core.LoggingManager.Info - WizardController.GetNVA_solution → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    System_Web_Mvc_LargeJsonResult_JsonEncode["System.Web.Mvc.LargeJsonResult.JsonEncode"]
    WizardController_GetNVA_solution["WizardController.GetNVA_solution"]
    WizardController_GetNVA_solution --> Andromeda_Core_LoggingManager_Error
    WizardController_GetNVA_solution --> Andromeda_Core_LoggingManager_Info
    WizardController_GetNVA_solution --> System_Web_Mvc_LargeJsonResult_JsonEncode
Detailed Analysis

Key Flows - send it via POST to the diagnostics endpoint - and return the JSON response on success. - Send POST request with JSON to '/run_nva_solution/' endpoint - log success and return response content as JSON

Error Flows - Summary: Log non-200 responses and return JSON false; handle GetAgentData and PostAsync errors. - Handle failures in GetAgentData and PostAsync methods - Log error on non-200 HTTP response with status code - Return JSON result with boolean false on error

Security Issues - Summary: Sending empty 'X-API-Key' header creates a security vulnerability. - Empty 'X-API-Key' header in HTTP request, Risk of unauthorized access due to missing API key

Performance Issues - Summary: The method blocks threads by synchronously waiting on asynchronous HTTP calls, reducing performance and scalability. - Blocking calls causing thread blocking, Synchronous waiting on asynchronous HTTP calls, Reduced scalability and responsiveness

Maintainability Issues - Summary: Replace magic strings with constants, fix typos, clarify method name, and remove incomplete code. - Use named constants instead of magic strings in configuration and logging

UX Impact Notes - Summary: Return JSON false on failure and error logging affect user error feedback. - Return JSON false on failure for user messages - Error logging impacts user error feedback

Test Case Ideas - Summary: Verify data retrieval, POST request success, response handling, and property/method existence. - Successful data retrieval from GetAgentData, Successful POST request to diagnostics endpoint, Correct JSON result or false based on response status, Existence and accessibility of 'Al' on 'estBehavior', Correct definition and usage of 'lowGet'

Dependencies & Called Services - Summary: Uses services for JSON response, logging, asynchronous tasks, timing, and wizard management. - LargeJsonResult for JSON responses, Task for asynchronous operations, TimeSpan for time intervals, Wizard for workflow management - LoggingManager for logging

GetInputDataJson

Summary: The method handles an HTTP GET request, retrieves data by type, and returns JSON to the client.

JsonResult WizardController.GetInputDataJson(string type)

Routing

  • HTTP: GET
  • URL: /Wizard/GetInputDataJson

Cross-layer call chain - WizardController.GetInputDataJson → System.Web.Mvc.LargeJsonResult.JsonEncode

Call Chain Diagram

flowchart TD
    System_Web_Mvc_LargeJsonResult_JsonEncode["System.Web.Mvc.LargeJsonResult.JsonEncode"]
    WizardController_GetInputDataJson["WizardController.GetInputDataJson"]
    WizardController_GetInputDataJson --> System_Web_Mvc_LargeJsonResult_JsonEncode
Detailed Analysis

Key Flows - Summary: The method handles an HTTP GET request - and returns JSON to the client. - Return JSON-encoded data with AllowGet behavior

Test Case Ideas - Summary: Verify HTTP GET response returns correct JSON for various input types. - Handle HTTP GET requests correctly - Return expected JSON object

Dependencies & Called Services - Summary: Uses LargeJsonResult and Wizard services for input data processing. - LargeJsonResult service, Wizard service

GetInputData

Summary: Retrieve and filter project activities and actors based on type and properties, applying sorting and limits as needed.

Object WizardController.GetInputData(string type, int? pType)

Routing

  • URL: /Wizard/GetInputData

Cross-layer call chain - WizardController.GetInputData → Andromeda.Core.Entities.PathData.GetPathIds - WizardController.GetInputData → Andromeda.Core.Extensions.LinqExtensions.getSkillScore - WizardController.GetInputData → Andromeda.Core.Entities.Actor.GetLocation - WizardController.GetInputData → Andromeda.Core.Entities.Actor.WorkStartTimeUTC - WizardController.GetInputData → Andromeda.Core.Entities.Actor.WorkEndTimeUTC - Andromeda.Core.Entities.Actor.GetLocation → Andromeda.Core.DataManager.GetData

Call Chain Diagram

flowchart TD
    Andromeda_Core_DataManager_GetData["Andromeda.Core.DataManager.GetData"]
    Andromeda_Core_Entities_Actor_GetLocation["Andromeda.Core.Entities.Actor.GetLocation"]
    Andromeda_Core_Entities_Actor_WorkEndTimeUTC["Andromeda.Core.Entities.Actor.WorkEndTimeUTC"]
    Andromeda_Core_Entities_Actor_WorkStartTimeUTC["Andromeda.Core.Entities.Actor.WorkStartTimeUTC"]
    Andromeda_Core_Entities_PathData_GetPathIds["Andromeda.Core.Entities.PathData.GetPathIds"]
    Andromeda_Core_Extensions_LinqExtensions_getSkillScore["Andromeda.Core.Extensions.LinqExtensions.getSkillScore"]
    WizardController_GetInputData["WizardController.GetInputData"]
    Andromeda_Core_Entities_Actor_GetLocation --> Andromeda_Core_DataManager_GetData
    WizardController_GetInputData --> Andromeda_Core_Entities_Actor_GetLocation
    WizardController_GetInputData --> Andromeda_Core_Entities_Actor_WorkEndTimeUTC
    WizardController_GetInputData --> Andromeda_Core_Entities_Actor_WorkStartTimeUTC
    WizardController_GetInputData --> Andromeda_Core_Entities_PathData_GetPathIds
    WizardController_GetInputData --> Andromeda_Core_Extensions_LinqExtensions_getSkillScore
Detailed Analysis

Key Flows - Summary: Retrieve and filter project activities and actors based on type and properties, applying sorting and limits as needed. - Check 'type' for 'ProcessMapRejection' and handle accordingly - Handle various 'type' values by retrieving and transforming related data - Filter activities without predecessors and return their IDs

Error Flows - Summary: Handle empty collections and prevent null reference exceptions in GetInputData. - Return null if baseActivities collection is empty after filtering - Return null if actors collection is empty

Security Issues - Summary: No security issues found; method handles no sensitive data. - No sensitive data handling, Method not marked sensitive

Performance Issues - Summary: LINQ methods and repeated collection enumerations degrade performance on large datasets. - Inefficient LINQ methods on large datasets

Maintainability Issues - Summary: Magic strings, unclear variable names, and complex LINQ reduce code clarity and maintainability. - Anonymous objects for returns and transformations hinder understanding and maintenance

UX Impact Notes - Summary: Returning null causes missing data and potential crashes - Null return causes no data display

Test Case Ideas - filtering logic - Evaluate performance with large datasets and LINQ queries - Return correctly structured anonymous objects for various type scenarios - Handle commented or incomplete code without breaking functionality - Handle missing or undefined methods or data gracefully - Process and return data for Mode and Controls types including default models and arrow details

Dependencies & Called Services - Summary: Uses various data types and interfaces for input data processing. - Actor data type, DateTime handling, Decimal type usage, Enumerable collections, IActorModel interface, IControlModel interface, IProcessModel interface, IWizardModel interface, Int32 type, LinqExtensions utilities, List collections, PathData structure, String type, Wizard class

GetActivityType

Summary: GetActivityType returns 'start' if an arrow's predecessor matches activityId when 'type' includes 'start' or 'end'; otherwise returns 'e'.

string WizardController.GetActivityType(string type, int activityId, IList<Arrow> arrows)

Routing

  • URL: /Wizard/GetActivityType
Detailed Analysis

Key Flows - Summary: GetActivityType returns 'start' if an arrow's predecessor matches activityId when 'type' includes 'start' or 'end'; otherwise returns 'e'. - Check if 'type' contains 'start' or 'end' case-insensitively - Return 'start' if matching predecessor found - Return 'e' if no matching predecessor found

Performance Issues - Summary: Optimize string casing and collection search to improve performance. - Repeated ToLower() calls on 'type' degrade performance, Inefficient Any() usage on large 'arrows' collection

Maintainability Issues - incomplete return values - Incomplete or truncated return value 'e' causes confusion

Test Case Ideas - Summary: Test GetActivityType for correct output across input variations and collection states. - Detect matching predecessor in arrows collection returns 'start' - Return fallback value when no matching predecessor - Return string output consistently - Handle 'type' with 'start' - Process empty arrows collection - Validate expected outputs including edge cases

Dependencies & Called Services - Summary: Uses Enumerable and String types for activity type retrieval. - Enumerable usage, String type usage

Wizard_ProcessMapRejection

Summary: Process valid pType to retrieve data, update statuses, save config, and return success response.

JsonResult WizardController.Wizard_ProcessMapRejection(int? pType)

Routing

  • HTTP: GET
  • URL: /Wizard/Wizard_ProcessMapRejection

Cross-layer call chain - WizardController.Wizard_ProcessMapRejection → System.Web.Mvc.LargeJsonResult.JsonEncode - WizardController.Wizard_ProcessMapRejection → Andromeda.Core.LoggingManager.Info - WizardController.Wizard_ProcessMapRejection → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    System_Web_Mvc_LargeJsonResult_JsonEncode["System.Web.Mvc.LargeJsonResult.JsonEncode"]
    WizardController_Wizard_ProcessMapRejection["WizardController.Wizard_ProcessMapRejection"]
    WizardController_Wizard_ProcessMapRejection --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_ProcessMapRejection --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_ProcessMapRejection --> System_Web_Mvc_LargeJsonResult_JsonEncode
Detailed Analysis

Key Flows - update statuses - and return success response. - Process IDs against 'ends' collection - Send POST request and receive HTTP OK - Return success JSON response - Update undesired statuses - Validate pType parameter

Error Flows - Summary: Log errors for non-OK HTTP responses to track request failures. - Avoid incomplete or malformed conditionals to prevent unexpected behavior and compilation errors - Log error with URL

Security Issues - Summary: The method risks API key misuse and JSON deserialization vulnerabilities. - Empty X-API-Key header risks unauthorized access, JSON deserialization using System.Web.Helpers.Json.Decode exposes vulnerability

Performance Issues - Summary: Avoid blocking synchronous calls and repeated conversions to improve performance. - Blocking synchronous calls degrade performance, Repeated Convert.ToInt32 calls in loops impact performance

Maintainability Issues - Summary: The method uses hardcoded values, reflection, and non-standard encoding, reducing clarity and flexibility. - Hardcoded WizardURL from AppSettings complicates configuration

UX Impact Notes - Summary: Returning false on null data signals rejection; error logging supports system reliability. - Log errors internally to maintain system reliability - Return false on null data indicates rejection

Test Case Ideas - and error logging in Wizard_ProcessMapRejection. - Check X-API-Key header presence in request - Handle various HTTP status codes from POST response - Log errors on non-OK POST response status - Validate pType parameter processing and JSON response - Ensure POST request sends correct JSON payload and headers - Confirm HttpClient timeout set to 60 minutes - Call UpdateUndesired only for IDs in 'ends'

Dependencies & Called Services - Summary: Uses type conversion, logging, asynchronous tasks, and data structures for process map rejection. - Logging management - Process model interface - Type conversion utilities, Large JSON result handling, List data structure, Reflection with PropertyInfo, Asynchronous Task handling, TimeSpan for timing, Type metadata, Wizard framework

Wizard_Salary

Summary: Process input data, request salary predictions, update infrastructure costs, and return success status.

JsonResult WizardController.Wizard_Salary(int? pType)

Routing

  • HTTP: GET
  • URL: /Wizard/Wizard_Salary

Cross-layer call chain - WizardController.Wizard_Salary → System.Web.Mvc.LargeJsonResult.JsonEncode - WizardController.Wizard_Salary → Andromeda.Core.LoggingManager.Info - WizardController.Wizard_Salary → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    System_Web_Mvc_LargeJsonResult_JsonEncode["System.Web.Mvc.LargeJsonResult.JsonEncode"]
    WizardController_Wizard_Salary["WizardController.Wizard_Salary"]
    WizardController_Wizard_Salary --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_Salary --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_Salary --> System_Web_Mvc_LargeJsonResult_JsonEncode
Detailed Analysis

Key Flows - update infrastructure costs - and return success status. - Check response status code for success - Send synchronous POST request to external salary prediction service - Add or update infrastructure data and save configuration - Return JSON result indicating success - Update office infrastructure with seat costs and currency codes - Validate input data and serialize to JSON

Error Flows - Summary: Handle null data - log HTTP errors - Log errors for non-OK HTTP status codes with incomplete details - Return false JSON for null or invalid data

Security Issues - Summary: Wizard_Salary exposes security risks via missing API key, unsanitized inputs, and insecure registry access. - Empty 'X-API-Key' header indicates missing or insecure API key, Unsanitized actId risks SQL injection or data corruption when saving skill costs, Access to sensitive Windows Registry data lacks clear security controls

Performance Issues - Summary: Avoid blocking calls and optimize repeated conversions and large collection filtering. - Blocking calls causing thread blocking and deadlocks, Repeated conversions without caching impacting loop performance, Inefficient filtering of large collections without safeguards

Maintainability Issues - Summary: The method suffers from unclear conditionals, mixed concerns, and poor naming harming maintainability. - Mixed concerns: logging

UX Impact Notes - Summary: Boolean JsonResult affects UI success interpretation and incomplete errors hinder troubleshooting. - Boolean JsonResult affects UI success or failure interpretation, Incomplete error messages hinder troubleshooting and user feedback, Incorrect or missing salary data causes inaccurate user information

Test Case Ideas - error logging - Handle HTTP timeouts and non-OK status codes - Handle empty or unexpected actors collection - Log errors with complete messages - Iterate WizardOutput.nodes assigning team_id and salary correctly - Return JSON true on success

Dependencies & Called Services - Summary: Uses models, collections, logging, async tasks, and result handling services. - Logging service: LoggingManager - Model interfaces: IActorModel, IInfraModel, IProcessModel, Collection types: Enumerable, List, Async programming: Task, TimeSpan, Result handling: LargeJsonResult, Domain-specific service: Wizard, Data conversion utility: Convert

Wizard_DOE

Summary: Wizard_DOE sends a POST request with valid parameters, processes successful responses into activity properties, saves them, and returns true; it logs errors on failed responses.

JsonResult WizardController.Wizard_DOE(int? pType)

Routing

  • HTTP: GET
  • URL: /Wizard/Wizard_DOE

Cross-layer call chain - WizardController.Wizard_DOE → System.Web.Mvc.LargeJsonResult.JsonEncode - WizardController.Wizard_DOE → Andromeda.Core.LoggingManager.Info - WizardController.Wizard_DOE → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    System_Web_Mvc_LargeJsonResult_JsonEncode["System.Web.Mvc.LargeJsonResult.JsonEncode"]
    WizardController_Wizard_DOE["WizardController.Wizard_DOE"]
    WizardController_Wizard_DOE --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_DOE --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_DOE --> System_Web_Mvc_LargeJsonResult_JsonEncode
Detailed Analysis

Key Flows - Summary: Wizard_DOE sends a POST request with valid parameters - and returns true; it logs errors on failed responses. - Log error on non-OK response - Process valid pType parameter for data retrieval, Process response content on OK status - Send POST request to external service - Return JSON true on success

Error Flows - Summary: Handles null data and HTTP errors but lacks exception handling and uses blocking calls. - Log error on non-OK HTTP response - Return JSON false if initial data is null

Security Issues - Summary: Adding an empty 'X-API-Key' header risks unauthorized access. - Empty 'X-API-Key' header value, Potential unauthorized access, Security vulnerability due to missing API key

Performance Issues - Summary: Synchronous calls and inefficient data handling reduce scalability and increase memory use. - Blocking synchronous calls on asynchronous methods causing thread blocking, Repeated integer conversions of 'actId' inside loops, Inefficient string manipulations and LINQ GroupBy on large collections, Performance issues iterating over large collections like WizardOutput.nodes and act.appli

Maintainability Issues - Summary: Code suffers from unclear literals, poor error handling, tight coupling, and reduced readability. - Incomplete and corrupted code snippets, Use of unexplained magic strings and numbers, Lack of error handling in JSON and type conversions, Tight coupling with ProcessMapModel and Registry classes, Use of anonymous types in LINQ GroupBy reducing clarity

UX Impact Notes - Summary: Return values and error messages directly affect user feedback and debugging. - Log error messages for user visibility or debugging - Return JSON true/false for UI success or failure feedback

Test Case Ideas - Summary: Validate POST request handling - error logging - Error logging on unsuccessful HTTP response - Return JSON true on success

Dependencies & Called Services - Summary: Uses core data types, collections, async tasks, logging, and domain-specific models. - Core data types (String, TimeSpan), Collections and LINQ (List, Enumerable), Asynchronous programming (Task), Domain models and interfaces (Wizard, IProcessModel, LargeJsonResult) - Logging management (LoggingManager)

Wizard_Product

Summary: Wizard_Product processes valid pType input, retrieves and saves products, updates activities, saves configuration, and returns success.

JsonResult WizardController.Wizard_Product(int? pType)

Routing

  • HTTP: GET
  • URL: /Wizard/Wizard_Product

Cross-layer call chain - WizardController.Wizard_Product → System.Web.Mvc.LargeJsonResult.JsonEncode - WizardController.Wizard_Product → Andromeda.Core.LoggingManager.Info - WizardController.Wizard_Product → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    System_Web_Mvc_LargeJsonResult_JsonEncode["System.Web.Mvc.LargeJsonResult.JsonEncode"]
    WizardController_Wizard_Product["WizardController.Wizard_Product"]
    WizardController_Wizard_Product --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_Product --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_Product --> System_Web_Mvc_LargeJsonResult_JsonEncode
Detailed Analysis

Key Flows - updates activities - and returns success. - POST to '/predict_product' and process returned product nodes - Return JSON true on success - Update related activity products - Validate pType and retrieve data via GetInputData

Error Flows - Summary: Handle null data - log failed POST requests - Log error and return JSON false on non-OK POST response - Return JSON false on null or invalid initial data

Security Issues - Summary: Fix empty API key and prevent SQL injection in product queries. - Empty API key in HTTP header risks unauthorized access, SQL injection vulnerability from unsanitized product name in database query

Performance Issues - Summary: Synchronous calls and inefficient collection handling degrade performance and scalability. - Synchronous blocking calls degrade performance and scalability, Iterating large collections without pagination causes slowdowns, Using ToList() on grouped collections increases memory usage, Calling FirstOrDefault inside loops causes inefficient queries

Maintainability Issues - Summary: Inconsistent naming, magic numbers, hardcoded strings, incomplete code, and unclear methods reduce maintainability. - Non-standard variable naming reduces readability, Incomplete and improperly formatted code causes errors, Magic numbers lack named constants, reducing clarity, Hardcoded strings reduce flexibility, Unclear and incomplete method usage reduces understandability

UX Impact Notes - Summary: Provide detailed error messages and user feedback for operation outcomes. - Log errors for diagnostics - Return detailed error messages instead of simple true/false JSON

Test Case Ideas - Summary: Validate Wizard_Product method for data retrieval - Validate method with valid pType for data retrieval and processing - and empty product name sets

Dependencies & Called Services - Summary: Uses data conversion, collections, models, logging, async tasks, and wizard components. - Data conversion utilities, Dictionary and Enumerable collections, Control and process models, Large JSON result handling, String operations, Asynchronous task handling, TimeSpan for time intervals, Wizard component integration - Logging management

Wizard_DecisionPercentage

Summary: Processes valid pType to retrieve data, update model, save config, and return success; logs errors on HTTP failure.

JsonResult WizardController.Wizard_DecisionPercentage(int? pType)

Routing

  • HTTP: GET
  • URL: /Wizard/Wizard_DecisionPercentage

Cross-layer call chain - WizardController.Wizard_DecisionPercentage → System.Web.Mvc.LargeJsonResult.JsonEncode - WizardController.Wizard_DecisionPercentage → Andromeda.Core.LoggingManager.Info - WizardController.Wizard_DecisionPercentage → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    System_Web_Mvc_LargeJsonResult_JsonEncode["System.Web.Mvc.LargeJsonResult.JsonEncode"]
    WizardController_Wizard_DecisionPercentage["WizardController.Wizard_DecisionPercentage"]
    WizardController_Wizard_DecisionPercentage --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_DecisionPercentage --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_DecisionPercentage --> System_Web_Mvc_LargeJsonResult_JsonEncode
Detailed Analysis

Key Flows - update model - and return success; logs errors on HTTP failure. - Logs errors and halts on unsuccessful HTTP response - Processes API response into ActivityProduct list - Updates control model and saves configuration - Returns JSON true on success

Error Flows - Summary: Handle null input - log HTTP errors - Log error with URL - Return JSON false on null or invalid input data

Security Issues - Summary: Adding an empty X-API-Key header risks unauthorized access. - Empty X-API-Key header value, Potential unauthorized access, Security vulnerability due to missing API key

Performance Issues - Summary: The method creates HttpClient instances repeatedly - and inefficiently handles conversions and list allocation. - Block asynchronous calls with response.Wait() and ReadAsStringAsync().Result degrading performance, Repeated Convert.ToInt32 and Convert.ToString calls in loops impacting performance - Create new HttpClient instance on each call without disposal causing socket exhaustion - Create new list without initial elements causing unnecessary memory allocation

Maintainability Issues - Summary: Improve code clarity, reduce coupling, and optimize repeated operations for maintainability. - Unclear and incomplete conditional statements, Use of magic strings for API URLs and status codes, Tight coupling with ControlModel and ProcessMapModel, Incomplete method calls and code fragments, Repeated access to Registry.CurrentProjectId without caching, Use of generic Convert methods instead of explicit type conversions

UX Impact Notes - Summary: Returning false without error details disrupts user flow and causes confusion. - Return false without failure reason

Test Case Ideas - Summary: Verify HTTP request, response handling, JSON processing, method calls, and edge case behaviors. - ProcessMapModel.SaveConfigurationDetails called with current project ID and correct parameters - HTTP POST request sends correct JSON payload and headers - Method handles HTTP response status codes correctly - ControlModel.UpdateArrowDecisionOutput and SetProduct called with correct parameters - Method handles empty or malformed WizardOutput nodes collection

Dependencies & Called Services - Summary: Uses models, result types, collections, logging, and task management services. - IControlModel dependency, IProcessModel dependency, LargeJsonResult for responses, List collection usage, Task for asynchronous operations, TimeSpan for time intervals, Wizard component usage, Convert utility - LoggingManager for logging

Wizard_AHT

Summary: Wizard_AHT processes valid input to update bulk AHT and handles POST request errors with logging and JSON responses.

JsonResult WizardController.Wizard_AHT(int? pType)

Routing

  • HTTP: GET
  • URL: /Wizard/Wizard_AHT

Cross-layer call chain - WizardController.Wizard_AHT → System.Web.Mvc.LargeJsonResult.JsonEncode - WizardController.Wizard_AHT → Andromeda.Core.LoggingManager.Info - WizardController.Wizard_AHT → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    System_Web_Mvc_LargeJsonResult_JsonEncode["System.Web.Mvc.LargeJsonResult.JsonEncode"]
    WizardController_Wizard_AHT["WizardController.Wizard_AHT"]
    WizardController_Wizard_AHT --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_AHT --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_AHT --> System_Web_Mvc_LargeJsonResult_JsonEncode
Detailed Analysis

Key Flows - Summary: Wizard_AHT processes valid input to update bulk AHT and handles POST request errors with logging and JSON responses. - Log error and return JSON response if POST status is not OK - Process valid pType input to retrieve data and update bulk AHT - Send POST request to external service and parse response - Save updated configuration and return JSON true

Error Flows - Summary: Handle null data - and unhandled serialization errors. - Non-OK POST response triggers error logging and error JSON response

Security Issues - Summary: The empty X-API-Key header risks unauthorized API access. - Empty X-API-Key header, Potential unauthorized API access

Performance Issues - Summary: The method blocks threads with synchronous waits and inefficient type conversions. - Blocking calls with response.Wait() and .Result causing thread blocking, Inefficient repeated Convert.ToString and Convert.ToInt32 calls in loops

Maintainability Issues - Summary: Fix incomplete conditions, replace magic values, add JSON error handling, clarify variable context. - Incomplete or truncated condition checks causing errors

UX Impact Notes - Summary: Return values and error logging directly affect UI feedback and user experience. - Return JSON false triggers UI error messages or redirects - Return JSON true updates UI or triggers further actions - Error logging on failed POST requests impacts application functionality and UX

Test Case Ideas - error logging - Correct parameters in UpdateBulkAHT and SaveConfigurationDetails calls - Return JSON true on successful processing - Error logging on non-OK POST response status

Dependencies & Called Services - Summary: Uses data conversion, logging, asynchronous tasks, and time management dependencies. - Data conversion utilities, Double precision operations, Large JSON result handling, List collections, Asynchronous task handling, TimeSpan for time intervals, Wizard framework - Logging management - Process model interface

Wizard_Deadline

Summary: Wizard_Deadline retrieves input, calls '/predict_deadline' API, processes deadlines, constructs deal paths, and returns JSON results.

JsonResult WizardController.Wizard_Deadline(int? pType)

Routing

  • HTTP: GET
  • URL: /Wizard/Wizard_Deadline

Cross-layer call chain - WizardController.Wizard_Deadline → System.Web.Mvc.LargeJsonResult.JsonEncode - WizardController.Wizard_Deadline → Andromeda.Core.LoggingManager.Info - WizardController.Wizard_Deadline → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    System_Web_Mvc_LargeJsonResult_JsonEncode["System.Web.Mvc.LargeJsonResult.JsonEncode"]
    WizardController_Wizard_Deadline["WizardController.Wizard_Deadline"]
    WizardController_Wizard_Deadline --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_Deadline --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_Deadline --> System_Web_Mvc_LargeJsonResult_JsonEncode
Detailed Analysis

Key Flows - and returns JSON results. - Check for HTTP 200 OK response status - Set API key header and serialize data to JSON - Send synchronous request to '/predict_deadline' endpoint - Return error or JSON response if success paths are empty - Encode processed data into JSON and return as JsonResult - Update activity properties including handling 'Relative' deadlines

Error Flows - Summary: Handle null data - Handle exceptions from actId conversion and JSON decoding failures - Log error and return error response on non-OK endpoint response - Return failure JSON if input data is null - Return error if deadline success path is empty

Security Issues - Summary: Fix deserialization flaws and avoid blocking calls in async methods to prevent DoS. - Deserialization vulnerability from improper JSON validation, Blocking calls in async methods causing DoS under load

Performance Issues - Summary: Synchronous calls, repeated object creation, inefficient LINQ, and improper HttpClient usage degrade performance. - Synchronous blocking calls block threads and degrade performance, Creating new HttpClient per request causes socket exhaustion, LINQ FirstOrDefault inside loops slows large collection processing, Large JSON encoding lacks optimization, InvariantCultureIgnoreCase string comparison is slower, Repeated list creation inside loops impacts performance, Unnecessary string conversion before parsing doubles

Maintainability Issues - Summary: The method suffers from unclear code, poor naming, tight coupling, and improper async usage. - Inconsistent naming conventions and incomplete null checks

UX Impact Notes - Summary: Returns JSON for AJAX - handles errors visibly - Return JSON data for AJAX deadline display

Test Case Ideas - Summary: Test endpoint responses, deadline types, activity handling, path construction, error cases, and performance. - Handle various deadline types including Absolute and Relative - Assess performance with large datasets for bottlenecks - Validate '/predict_deadline' endpoint responses for HTTP 200

Dependencies & Called Services - Summary: Uses data types, collections, async tasks, logging, and domain-specific models. - Data type conversions, Dictionary and List collections, Double and TimeSpan types, Enumerable interface, Async Task handling, Domain models: IActorModel, IFinalPlanModel, IProcessModel, LargeJsonResult for JSON responses, Wizard class usage - LoggingManager for logging

Wizard_Waittype

Summary: Process valid pType to retrieve data, call external API, handle activities and wait types, save config, and return success; for pType 1, additionally process and filter wait type arrows before saving.

JsonResult WizardController.Wizard_Waittype(int? pType)

Routing

  • HTTP: GET
  • URL: /Wizard/Wizard_Waittype

Cross-layer call chain - WizardController.Wizard_Waittype → System.Web.Mvc.LargeJsonResult.JsonEncode - WizardController.Wizard_Waittype → Andromeda.Core.LoggingManager.Info - WizardController.Wizard_Waittype → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    System_Web_Mvc_LargeJsonResult_JsonEncode["System.Web.Mvc.LargeJsonResult.JsonEncode"]
    WizardController_Wizard_Waittype["WizardController.Wizard_Waittype"]
    WizardController_Wizard_Waittype --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_Waittype --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_Waittype --> System_Web_Mvc_LargeJsonResult_JsonEncode
Detailed Analysis

Key Flows - handle activities and wait types - and return success; for pType 1 - Process activities and wait types, Process wait type arrows collection before saving - Send POST request to external API - Return JSON success result

Error Flows - Summary: Handles null data - and invalid ID conversions with error logging and false returns. - Handle exceptions during integer conversions of IDs - Log errors on unsuccessful API responses - Return false JSON on null or invalid data

Security Issues - Summary: The method exposes security risks by using an empty API key and unvalidated JSON decoding. - Use of empty API key in HTTP request, Decoding JSON response without validation

Performance Issues - Summary: Long timeouts and blocking calls degrade responsiveness; inefficient loops reduce performance. - HttpClient timeout set to 60 minutes causes slow response handling

Maintainability Issues - Summary: Code suffers from unclear logic - Mixed logging - and business logic in single blocks

UX Impact Notes - Summary: The method may cause UI delays, insufficient feedback, and hinder error troubleshooting. - JSON false response triggers UI updates or error messages

Test Case Ideas - and error logging. - Add arrows to waitTypeArrow when duration > 0 with correct properties, Save wait types and configuration with accurate data persistence - Handle empty and non-empty waitTypeArrow collections correctly - Log appropriate error messages on failures

Dependencies & Called Services - Summary: Uses core system types, collections, async tasks, logging, and domain-specific models. - Core system types (Convert, Double, String, TimeSpan), Collections and LINQ (Enumerable, List), Asynchronous programming (Task), Domain models (IProcessModel, Wizard, LargeJsonResult) - Logging via LoggingManager

Wizard_Forms

Summary: No key flows are defined for the Wizard_Forms method.

JsonResult WizardController.Wizard_Forms(int? pType)

Routing

  • HTTP: GET
  • URL: /Wizard/Wizard_Forms

Cross-layer call chain - WizardController.Wizard_Forms → System.Web.Mvc.LargeJsonResult.JsonEncode - WizardController.Wizard_Forms → Andromeda.Core.LoggingManager.Info - WizardController.Wizard_Forms → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    System_Web_Mvc_LargeJsonResult_JsonEncode["System.Web.Mvc.LargeJsonResult.JsonEncode"]
    WizardController_Wizard_Forms["WizardController.Wizard_Forms"]
    WizardController_Wizard_Forms --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_Forms --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_Forms --> System_Web_Mvc_LargeJsonResult_JsonEncode
Detailed Analysis

Key Flows - Summary: No key flows are defined for the Wizard_Forms method.

Error Flows - Summary: Handle invalid input and HTTP errors; lacks exception handling for conversions and JSON operations. - Log errors on HTTP POST failure or non-OK status - Return JSON false for null or invalid input

Security Issues - Summary: The HTTP client misconfigures API key header and uses blocking calls causing deadlocks. - Empty 'X-API-Key' header risks security or indicates misconfiguration, Synchronous blocking on async methods causes thread starvation and deadlocks

Performance Issues - Summary: Synchronous calls, repeated expensive method calls, costly string operations, and heavy LINQ usage degrade performance. - Synchronous blocking calls in async HTTP handling, Repeated calls to expensive methods without caching, Costly string operations on large collections, High memory and slow execution from LINQ GroupBy and Min on large collections

Maintainability Issues - Summary: Code suffers from tight coupling, unclear naming, and improper resource management. - Tight coupling with hardcoded HTTP status codes, URLs, and magic strings, Unclear variable naming and use of anonymous types reduce readability, Improper disposal of HttpClient instances causes resource leaks

UX Impact Notes - Summary: Provide immediate feedback on invalid input but avoid blocking calls and unclear error impacts. - Return JSON false for invalid input to give immediate user feedback

Test Case Ideas - Summary: Test Wizard_Forms for correct data handling, error resilience, and performance under load. - Check arrow mode updates under various conditions and data states - Assess grouping and processing of activity properties with empty and large sets - Confirm final configuration saving with JSON success response or error logging - Measure performance impact on LINQ operations and string manipulations with large datasets - Validate HTTP POST with valid JSON and response processing

Dependencies & Called Services - Summary: Uses data conversion, collections, control and process models, logging, async tasks, and wizard components. - Data conversion utilities, Enumerable collections, Control model interfaces, Large JSON result handling, List collections, String operations, Asynchronous task handling, Time span management, Wizard component - Logging management - Process model interfaces

Wizard_BRules

Summary: Process optional pType, send data to external API, handle response, save configuration, and return success.

JsonResult WizardController.Wizard_BRules(int? pType)

Routing

  • HTTP: GET
  • URL: /Wizard/Wizard_BRules

Cross-layer call chain - WizardController.Wizard_BRules → System.Web.Mvc.LargeJsonResult.JsonEncode - WizardController.Wizard_BRules → Andromeda.Core.LoggingManager.Info - WizardController.Wizard_BRules → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    System_Web_Mvc_LargeJsonResult_JsonEncode["System.Web.Mvc.LargeJsonResult.JsonEncode"]
    WizardController_Wizard_BRules["WizardController.Wizard_BRules"]
    WizardController_Wizard_BRules --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_BRules --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_BRules --> System_Web_Mvc_LargeJsonResult_JsonEncode
Detailed Analysis

Key Flows - send data to external API - handle response - and return success. - Create and group activity properties - Process successful API response - Send data to external API - Return JSON true

Error Flows - Summary: Handle invalid input - and unsuccessful HTTP responses with error logging. - Log error if questBehavior.AllowGet is false after API call - Log errors and halt processing on unsuccessful HTTP response status - Return JSON false for null or invalid input data

Security Issues - Summary: The API key header is missing in POST requests, causing a security risk. - Empty API key header in POST requests, Potential security vulnerability due to missing authentication

Performance Issues - Summary: Blocking calls and inefficient data processing degrade performance and increase memory use. - Multiple LINQ methods with repeated string trimming and lowercasing reduce performance on large datasets - Use of ToList() risks high memory usage for large datasets

Maintainability Issues - Summary: Replace magic strings and unclear variable names; reduce tight class coupling. - Use named constants for logging message strings

UX Impact Notes - Summary: Return values and error logging directly impact user workflow clarity and responsiveness. - Returning JSON false on null data indicates failure and disrupts workflow - Returning JSON true on success clearly signals operation success - Error logging can degrade user experience if errors surface or cause delays

Test Case Ideas - Summary: Test method behavior for API errors, logging, parameter correctness, and successful JSON response. - Return JSON true on successful completion without errors - Return correctly without errors on early exit - Handle unresponsive or error external endpoints - Handle various HTTP response status codes - Log correctly when questBehavior.AllowGet is false or API response fails

Dependencies & Called Services - Summary: Uses core data types, collections, async tasks, logging, and domain-specific models. - Core data types (String, TimeSpan), Collections and LINQ (Enumerable, List), Asynchronous programming (Task), Domain models and interfaces (IProcessModel, Wizard), Custom result handling (LargeJsonResult) - Logging management (LoggingManager)

Wizard_NVA

Summary: Wizard_NVA processes valid pType requests, posts data to an external API, handles responses, saves activities and configuration, and returns success status.

JsonResult WizardController.Wizard_NVA(int? pType)

Routing

  • HTTP: GET
  • URL: /Wizard/Wizard_NVA

Cross-layer call chain - WizardController.Wizard_NVA → System.Web.Mvc.LargeJsonResult.JsonEncode - WizardController.Wizard_NVA → Andromeda.Core.LoggingManager.Info - WizardController.Wizard_NVA → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    System_Web_Mvc_LargeJsonResult_JsonEncode["System.Web.Mvc.LargeJsonResult.JsonEncode"]
    WizardController_Wizard_NVA["WizardController.Wizard_NVA"]
    WizardController_Wizard_NVA --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_NVA --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_NVA --> System_Web_Mvc_LargeJsonResult_JsonEncode
Detailed Analysis

Key Flows - handles responses - and returns success status. - Handle successful API response and process activities - Log error and return failure on unsuccessful API response - Process valid pType parameter for data retrieval and serialization - Send POST request to external API

Error Flows - Summary: Handle invalid input - Null or invalid input causes immediate JSON false return - Unsuccessful external API response triggers error logging and JSON false return

Security Issues - Summary: The method risks API key misconfiguration and SQL injection vulnerabilities. - Empty X-API-Key header indicates missing or misconfigured API key, Potential SQL injection from unsanitized Registry.CurrentProjectId in data saving

Performance Issues - Summary: Synchronous blocking and inefficient data operations degrade performance. - Inefficient List.Contains and ordering with Take on large datasets

Maintainability Issues - Summary: Fix unclear conditionals, hardcoded URLs, typos, magic values, missing error handling, and unclear references. - Hardcoded URL '/predict_nva' and AppSettings retrieval reduce flexibility - Magic strings in logging lack constants usage

UX Impact Notes - Summary: Invalid data and unclear error feedback disrupt user workflow. - Returning JSON false on null or invalid data disrupts workflow

Test Case Ideas - Summary: Verify correct POST request, response handling, activity processing, and success indication. - Return JSON true on successful completion

Dependencies & Called Services - Summary: Uses core data types, collections, async tasks, logging, and domain-specific models. - Core data types Int32 and TimeSpan, Collections List and Enumerable, Asynchronous Task handling, Domain models IActorModel, IProcessModel, Wizard, LargeJsonResult for JSON responses - LoggingManager for logging

Wizard_Controls

Summary: Retrieve input data, send it for risk assessment, process objectives with associated risks, activities, and controls, then save and return prediction status.

JsonResult WizardController.Wizard_Controls()

Routing

  • HTTP: GET
  • URL: /Wizard/Wizard_Controls

Cross-layer call chain - WizardController.Wizard_Controls → System.Web.Mvc.LargeJsonResult.JsonEncode - WizardController.Wizard_Controls → Andromeda.Core.LoggingManager.Info - WizardController.Wizard_Controls → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_LoggingManager_Info["Andromeda.Core.LoggingManager.Info"]
    System_Web_Mvc_LargeJsonResult_JsonEncode["System.Web.Mvc.LargeJsonResult.JsonEncode"]
    WizardController_Wizard_Controls["WizardController.Wizard_Controls"]
    WizardController_Wizard_Controls --> Andromeda_Core_LoggingManager_Error
    WizardController_Wizard_Controls --> Andromeda_Core_LoggingManager_Info
    WizardController_Wizard_Controls --> System_Web_Mvc_LargeJsonResult_JsonEncode
Detailed Analysis

Key Flows - send it for risk assessment - then save and return prediction status. - Process objectives by saving them and handling associated risks and activities - Send POST request with serialized data to risk assessment endpoint - Save project configuration and return JSON with objectives' prediction status

Error Flows - Summary: Handle HTTP errors - null checks - Check for null collections before use - Handle exceptions during HTTP requests explicitly - Log errors for non-OK HTTP responses - Return JSON false on initial data retrieval failure - Validate string-to-integer conversions for IDs

Security Issues - and validate inputs to prevent attacks. - Empty API key risks unauthorized access, SQL injection risk in SaveObjective without input sanitization, User information handling risks unauthorized access, Missing input validation and error handling risks injection and runtime errors

Performance Issues - Summary: Blocking calls, inefficient loops, excessive memory use, repeated string operations, and socket exhaustion degrade performance. - High memory usage from loading entire datasets with ToList()

Maintainability Issues - Summary: The method suffers from incomplete code, tight coupling, unclear naming, unused variables, and complex expressions. - Incomplete and truncated code segments, Tight coupling with external classes reducing modularity and testability, Use of magic strings for control names and string replacements, Unused or incomplete variable declarations indicating code smells or bugs, Complex ternary operators and LINQ expressions reducing readability

UX Impact Notes - Summary: Long HTTP requests and silent errors degrade UX; JSON responses guide interface behavior. - Silent error logging leaves users unaware of issues - JSON boolean false responses handle user validation scenarios

Test Case Ideas - iteration logic - database updates - Handle HTTP response status codes - Handle incomplete or malformed input data gracefully - Process risks within objectives and update database - Process activities within objectives and update database - Return JsonResult and call GetInputData - Iterate objectives and call SaveObjective with property updates - Save configuration details and return expected JSON

Dependencies & Called Services - Summary: Uses data conversion, asynchronous processing, logging, and domain-specific models. - Data conversion utilities, Enumerable collections, Asynchronous Task handling, TimeSpan for time management, IProcessModel interface, IRiskModel interface, LargeJsonResult for JSON responses, String operations, Wizard domain model - LoggingManager for logging

VerifyBelongsToSameIndustry

Summary: VerifyBelongsToSameIndustry checks entity type, validates industry match via InsorceOpenAICalls, and inserts corresponding master records.

JsonResult WizardController.VerifyBelongsToSameIndustry()

Routing

  • HTTP: POST
  • URL: /Wizard/VerifyBelongsToSameIndustry

Cross-layer call chain - WizardController.VerifyBelongsToSameIndustry → Insorce.Helpers.InsorceOpenAICalls.CheckProduct - WizardController.VerifyBelongsToSameIndustry → Insorce.Helpers.InsorceOpenAICalls.CheckForm - WizardController.VerifyBelongsToSameIndustry → Insorce.Helpers.InsorceOpenAICalls.CheckBusinessRule - Insorce.Helpers.InsorceOpenAICalls.CheckProduct → Andromeda.Core.LoggingManager.Error - Insorce.Helpers.InsorceOpenAICalls.CheckForm → Andromeda.Core.LoggingManager.Error - Insorce.Helpers.InsorceOpenAICalls.CheckBusinessRule → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Insorce_Helpers_InsorceOpenAICalls_CheckBusinessRule["Insorce.Helpers.InsorceOpenAICalls.CheckBusinessRule"]
    Insorce_Helpers_InsorceOpenAICalls_CheckForm["Insorce.Helpers.InsorceOpenAICalls.CheckForm"]
    Insorce_Helpers_InsorceOpenAICalls_CheckProduct["Insorce.Helpers.InsorceOpenAICalls.CheckProduct"]
    WizardController_VerifyBelongsToSameIndustry["WizardController.VerifyBelongsToSameIndustry"]
    Insorce_Helpers_InsorceOpenAICalls_CheckBusinessRule --> Andromeda_Core_LoggingManager_Error
    Insorce_Helpers_InsorceOpenAICalls_CheckForm --> Andromeda_Core_LoggingManager_Error
    Insorce_Helpers_InsorceOpenAICalls_CheckProduct --> Andromeda_Core_LoggingManager_Error
    WizardController_VerifyBelongsToSameIndustry --> Insorce_Helpers_InsorceOpenAICalls_CheckBusinessRule
    WizardController_VerifyBelongsToSameIndustry --> Insorce_Helpers_InsorceOpenAICalls_CheckForm
    WizardController_VerifyBelongsToSameIndustry --> Insorce_Helpers_InsorceOpenAICalls_CheckProduct
Detailed Analysis

Key Flows - Summary: VerifyBelongsToSameIndustry checks entity type - validates industry match via InsorceOpenAICalls - Call InsorceOpenAICalls.CheckProduct - CheckForm - or CheckBusinessRule with industry and entity data - or business rule master record if check returns 'Yes'

Error Flows - Summary: Handle verification failures and input validation to prevent runtime errors. - Verification result not 'Yes' prevents master record insertion, Lack of input validation or sanitization risks unexpected behavior, Incomplete code causes runtime errors

Security Issues - Summary: Validate and sanitize Request.Form data to prevent injection attacks. - Unvalidated Request.Form data

Maintainability Issues - Summary: The method uses unclear naming, magic strings, incomplete code, and tight class coupling, harming maintainability. - Use of magic strings for concatenation and form keys, Incomplete and truncated code segments, Tight coupling with Registry and ProcessMapModel classes, Non-standard and non-descriptive method and variable names, Variable naming inconsistencies violating camelCase conventions

UX Impact Notes - Summary: Verification results alter user flow based on industry match. - Conditional user flow based on industry verification

Test Case Ideas - Summary: Verify industry matching logic - Test InsorceOpenAICalls.CheckProduct - CheckForm - and CheckBusinessRule with diverse inputs - Validate 'Ind' string construction with varied project tags and industries

Dependencies & Called Services - Summary: Uses process model and OpenAI calls with string data for verification. - IProcessModel dependency, InsorceOpenAICalls service, String data input