Skip to content

InfraController

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

Overview

The InfraController manages infrastructure-related features within a project management system. It supports configuration, cost estimation, and operational site management for infrastructure components.

Feature Summary

  • Manages infrastructure dashboards, custom reports, and widgets.
  • Handles operational site initialization, validation, and updates.
  • Supports cost wizard workflows for new and existing teams with currency and configuration management.
  • Processes infrastructure data saving, including location infrastructure and impact status updates.
  • Provides infrastructure summaries and recommended quantity calculations.
  • Retrieves project cost, control, and cycle time data.
  • Updates location splits and manages office and team associations.

UX Summary

  • Dashboard view persistence via cookies enhances user continuity.
  • Redirects and filtering in cost wizards may disrupt user workflow.
  • Form submissions redirect users to maintain clear navigation paths.
  • Validation and error notifications impact user experience during data entry.
  • Summary views provide navigation references but tight coupling may reduce maintainability.
  • Incorrect calculations or JSON decoding errors degrade user experience.

Data Dependencies

  • Loads and updates project, office, and location infrastructure data.
  • Manages currency and foreign exchange rate data for cost calculations.
  • Processes configuration data for infrastructure components and depreciation.
  • Handles JSON deserialization for infrastructure and configuration objects.
  • Updates project status and impact metrics based on infrastructure changes.

Authentication / Authorization Notes

  • Several methods lack explicit authentication and authorization checks, risking information disclosure.
  • Cookie-based dashboard ID management risks unauthorized access via tampering.
  • User inputs require validation to prevent injection and data tampering vulnerabilities.
  • Security configurations and input sanitization need improvement to mitigate XSS and SQL injection risks.

Controller Call Chain Diagram

flowchart TD
    Andromeda_Core_DataManager_GetData["Andromeda.Core.DataManager.GetData"]
    Andromeda_Core_Entities_Activity_Clone["Andromeda.Core.Entities.Activity.Clone"]
    Andromeda_Core_Entities_Actor_GetLocation["Andromeda.Core.Entities.Actor.GetLocation"]
    Andromeda_Core_Entities_Arrow_Clone["Andromeda.Core.Entities.Arrow.Clone"]
    Andromeda_Core_Extensions_LinqExtensions_CurrencyConverter["Andromeda.Core.Extensions.LinqExtensions.CurrencyConverter"]
    Andromeda_Core_Extensions_LinqExtensions_DaysConverter["Andromeda.Core.Extensions.LinqExtensions.DaysConverter"]
    Andromeda_Core_Extensions_LinqExtensions_GetPathIds["Andromeda.Core.Extensions.LinqExtensions.GetPathIds"]
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_Services_Algorithms_Delooper_GetLoopingArrows["Andromeda.Core.Services.Algorithms.Delooper.GetLoopingArrows"]
    Andromeda_Core_Services_Algorithms_Delooper_GetSourcesAndSinks["Andromeda.Core.Services.Algorithms.Delooper.GetSourcesAndSinks"]
    Andromeda_Core_Services_Algorithms_Delooper_deloop["Andromeda.Core.Services.Algorithms.Delooper.deloop"]
    Andromeda_Core_Services_ProcessExtensions_FindByID["Andromeda.Core.Services.ProcessExtensions.FindByID"]
    InfraController_GetProjectCCC["InfraController.GetProjectCCC"]
    InfraController_Index["InfraController.Index"]
    InfraController_SaveOperationSiteInfo["InfraController.SaveOperationSiteInfo"]
    InfraController_saveInfraDetails["InfraController.saveInfraDetails"]
    Insorce_Helpers_Helpers_DaysConverter["Insorce.Helpers.Helpers.DaysConverter"]
    Insorce_Helpers_Helpers_SetDashboardIdToCookie["Insorce.Helpers.Helpers.SetDashboardIdToCookie"]
    Insorce_Helpers_Helpers_getDashboardIdFromCookie["Insorce.Helpers.Helpers.getDashboardIdFromCookie"]
    Andromeda_Core_Entities_Actor_GetLocation --> Andromeda_Core_DataManager_GetData
    Andromeda_Core_Extensions_LinqExtensions_CurrencyConverter --> Andromeda_Core_Extensions_LinqExtensions_CurrencyConverter
    Andromeda_Core_Services_Algorithms_Delooper_GetSourcesAndSinks --> Andromeda_Core_Extensions_LinqExtensions_GetPathIds
    Andromeda_Core_Services_Algorithms_Delooper_GetSourcesAndSinks --> Andromeda_Core_Services_ProcessExtensions_FindByID
    Andromeda_Core_Services_Algorithms_Delooper_deloop --> Andromeda_Core_LoggingManager_Error
    Andromeda_Core_Services_Algorithms_Delooper_deloop --> Andromeda_Core_Services_ProcessExtensions_FindByID
    InfraController_GetProjectCCC --> Andromeda_Core_Entities_Activity_Clone
    InfraController_GetProjectCCC --> Andromeda_Core_Entities_Arrow_Clone
    InfraController_GetProjectCCC --> Andromeda_Core_Extensions_LinqExtensions_CurrencyConverter
    InfraController_GetProjectCCC --> Andromeda_Core_Services_Algorithms_Delooper_GetLoopingArrows
    InfraController_GetProjectCCC --> Andromeda_Core_Services_Algorithms_Delooper_GetSourcesAndSinks
    InfraController_GetProjectCCC --> Andromeda_Core_Services_Algorithms_Delooper_deloop
    InfraController_GetProjectCCC --> Andromeda_Core_Services_ProcessExtensions_FindByID
    InfraController_GetProjectCCC --> Insorce_Helpers_Helpers_DaysConverter
    InfraController_Index --> Andromeda_Core_Entities_Actor_GetLocation
    InfraController_Index --> Insorce_Helpers_Helpers_SetDashboardIdToCookie
    InfraController_Index --> Insorce_Helpers_Helpers_getDashboardIdFromCookie
    InfraController_SaveOperationSiteInfo --> Andromeda_Core_LoggingManager_Error
    InfraController_saveInfraDetails --> Andromeda_Core_LoggingManager_Error
    Insorce_Helpers_Helpers_DaysConverter --> Andromeda_Core_Extensions_LinqExtensions_DaysConverter

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
costwizard CostWizard Tuple<IList<Andromeda.Core.Entities.RefInfraMaster>, Andromeda.Core.Entities.OfficePremise> Andromeda.Web\Views\Infra\CostWizard.cshtml
index Index IList<Andromeda.Core.Entities.CustomWidgetView> Andromeda.Web\Views\Infra\Index.cshtml
operationsites OperationSites IEnumerable<Andromeda.Core.Entities.LocationInfra> Andromeda.Web\Views\Infra\OperationSites.cshtml
summary Summary Tuple<IList<Andromeda.Core.Entities.InfraDetails>, Andromeda.Core.Entities.LocationInfra> Andromeda.Web\Views\Infra\Summary.cshtml

Methods at a Glance

Command / Save Operations

Type Method HTTP URL Summary
entrypoint CostWizardexistingteam GET /Infra/CostWizardexistingteam Load office and currency data for the current project, ensure key currencies...
entrypoint GetStandardConfigurations GET /Infra/GetStandardConfigurations GetStandardConfigurations loads and filters configurations by infrastructure...
entrypoint Summary GET /Infra/Summary Retrieve and display infrastructure summaries, update impact statuses, and...
entrypoint GettRecommendedQuantityNewLocation POST /Infra/GettRecommendedQuantityNewLocation Decode request data, create infrastructure objects, compute recommended...

Export & Reporting

Type Method HTTP URL Summary
entrypoint Index GET /Infra/Index The method sets a dashboard ID cookie if a view parameter exists and loads...

Validation & Rules

Type Method HTTP URL Summary
entrypoint OperationSites GET /Infra/OperationSites Initialize project context, validate activities, filter offices by team, and...
entrypoint CostWizard GET /Infra/CostWizard Validate parameters, load project and office data, manage currencies, handle...
entrypoint saveInfraDetails POST /Infra/saveInfraDetails The method decodes and processes infrastructure data, validates selections...

Workflow & Routing

Type Method HTTP URL Summary
entrypoint SaveOperationSites POST /Infra/SaveOperationSites Receive and process HTTP POST requests containing form data.
entrypoint SaveOperationSiteInfo POST /Infra/SaveOperationSiteInfo Process form data to update location infrastructure and impact statuses based...
entrypoint GettRecommendedQuantity POST /Infra/GettRecommendedQuantity The method processes a POST request, decodes configuration, calculates...
entrypoint GetProjectCCC GET /Infra/GetProjectCCC Retrieve and update project data, calculate costs and metrics, and...
entrypoint UpdateLocationSplit POST /Infra/UpdateLocationSplit UpdateLocationSplit processes location data from the form, updates office and...

Other Methods

Type Method HTTP URL Summary
entrypoint CostWizardNewTeam POST /Infra/CostWizardNewTeam Load FX rates, office data, and initialize infrastructure and connectivity with...

Associated Screens / Views

  • IndexIndex (Andromeda.Web\Views\Infra\Index.cshtml)
  • OperationSitesOperationSites (Andromeda.Web\Views\Infra\OperationSites.cshtml)
  • CostWizardCostWizard (Andromeda.Web\Views\Infra\CostWizard.cshtml)
  • SummarySummary (Andromeda.Web\Views\Infra\Summary.cshtml)

Entrypoint Methods

Index

Summary: The method sets a dashboard ID cookie if a view parameter exists and loads custom reports, views, and widgets for the dashboard.

ActionResult InfraController.Index(int? view)

Routing

  • HTTP: GET
  • URL: /Infra/Index

Cross-layer call chain - InfraController.Index → Insorce.Helpers.Helpers.getDashboardIdFromCookie - InfraController.Index → Insorce.Helpers.Helpers.SetDashboardIdToCookie - InfraController.Index → Andromeda.Core.Entities.Actor.GetLocation - 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"]
    InfraController_Index["InfraController.Index"]
    Insorce_Helpers_Helpers_SetDashboardIdToCookie["Insorce.Helpers.Helpers.SetDashboardIdToCookie"]
    Insorce_Helpers_Helpers_getDashboardIdFromCookie["Insorce.Helpers.Helpers.getDashboardIdFromCookie"]
    Andromeda_Core_Entities_Actor_GetLocation --> Andromeda_Core_DataManager_GetData
    InfraController_Index --> Andromeda_Core_Entities_Actor_GetLocation
    InfraController_Index --> Insorce_Helpers_Helpers_SetDashboardIdToCookie
    InfraController_Index --> Insorce_Helpers_Helpers_getDashboardIdFromCookie
View Metadata
  • View: Index (Andromeda.Web\Views\Infra\Index.cshtml)
  • Model: IList<Andromeda.Core.Entities.CustomWidgetView>
Detailed Analysis

Key Flows - Summary: The method sets a dashboard ID cookie if a view parameter exists and loads custom reports - Set dashboard ID cookie from view parameter

Error Flows - Summary: The method lacks explicit error handling for cookie and data retrieval failures. - No error handling for missing or malformed cookies, No management of data retrieval failures from models

Security Issues - Summary: The getDashboardIdFromCookie method risks unauthorized access via cookie tampering. - Cookie tampering vulnerability in getDashboardIdFromCookie, Risk of unauthorized access from manipulated cookies

Performance Issues - Summary: Ordering custom widgets degrades performance on large or complex datasets. - Ordering custom widgets on large or complex datasets

Maintainability Issues - Summary: The method suffers from naming errors, tight coupling, undefined calls, and incomplete code. - Misspelled or incomplete method name, Tight coupling with multiple model classes and helpers, Undefined method call with hardcoded argument, Incomplete code snippet indicating quality issues

UX Impact Notes - Summary: The method controls user flow and persists dashboard view using cookies. - Flexible user flow via ActionResult return type

Test Case Ideas - Summary: Verify dashboard ID handling, cookie and session management, and data retrieval correctness. - Validate 'view' parameter integer usage for dashboard ID and data population - Verify getDashboardIdFromCookie returns correct dashboard ID for various cookies - Ensure SetDashboardIdToCookie sets cookie correctly when 'view' has value

Dependencies & Called Services - Summary: Uses core utilities and interfaces for processing and project modeling. - Enumerable utilities, Helper functions, IProcessModel interface, IProjectModel interface, Int32 data type

OperationSites

Summary: Initialize project context, validate activities, filter offices by team, and prepare financial and accreditation data for the view.

ActionResult InfraController.OperationSites(int? CurrentPId, string screen, string TeamIds)

Routing

  • HTTP: GET
  • URL: /Infra/OperationSites
View Metadata
  • View: OperationSites (Andromeda.Web\Views\Infra\OperationSites.cshtml)
  • Model: IEnumerable<Andromeda.Core.Entities.LocationInfra>
Detailed Analysis

Key Flows - validate activities - Set financial data per office including TotalCost and exchange rates - Redirect to ProcessCreation if no activities

Error Flows - Summary: Handle empty activities by redirecting and prevent exceptions from missing project currency. - Prevent exception from unhandled First method on missing project currency - Redirect to ProcessCreation if activities collection is empty

Security Issues - Summary: OperationSites risks information disclosure from missing authentication and authorization checks. - Potential information disclosure from permission and status checks

Performance Issues - Summary: Optimize data retrieval and collection operations to prevent multiple iterations and slowdowns. - Unoptimized 'aModel.getActivities' for large datasets

Maintainability Issues - Summary: Fix unused variables, incomplete code, inconsistent naming, and replace magic strings for clarity. - Typo in property assignment 'office.TotalCost = office.Tota' - Incomplete ViewData assignments and partial code snippets

UX Impact Notes - Summary: Redirecting users without activities disrupts flow; ViewData affects UI rendering. - Pass accreditation review status and data via ViewData to influence UI - Redirect users to ProcessCreation when no activities exist

Test Case Ideas - Summary: Verify data retrieval, filtering, calculations, state changes, and error-free execution in OperationSites. - Fetch correct exchange rate for project currency - Handle empty activities collection and redirect to ProcessCreation - Initialize and update AnyoneAccReviewed flag correctly - Return expected values from LINQ query on Constants.ModuleRelations - Apply conditional logic for approved and unapproved site statuses - Validate correct activity count from aModel.getActivities

Dependencies & Called Services - Summary: Uses enumerable collections and interfaces for actor, infrastructure, and project models with basic data types. - Enumerable collections, IActorModel interface, IInfraModel interface, IProjectModel interface, Int32 data type, String data type

SaveOperationSites

Summary: Receive and process HTTP POST requests containing form data.

ActionResult InfraController.SaveOperationSites(FormCollection lst)

Routing

  • HTTP: POST
  • URL: /Infra/SaveOperationSites
Detailed Analysis

Key Flows - Summary: Receive and process HTTP POST requests containing form data. - Process form data - Receive HTTP POST request

UX Impact Notes - Summary: Redirects user to OperationSites after saving for clear navigation. - User redirection to OperationSites after save

Test Case Ideas - Summary: Verify SaveOperationSites handles POST requests - and redirects correctly. - Invoke SaveOperationSites on HTTP POST request, Call SaveOperationSiteInfo with correct form data - Redirect to OperationSites action successfully

Dependencies & Called Services - Summary: SaveOperationSites depends on Infra service. - Infra service dependency

SaveOperationSiteInfo

Summary: Process form data to update location infrastructure and impact statuses based on component and connectivity flags.

void InfraController.SaveOperationSiteInfo(FormCollection Coll)

Routing

  • HTTP: POST
  • URL: /Infra/SaveOperationSiteInfo

Cross-layer call chain - InfraController.SaveOperationSiteInfo → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    InfraController_SaveOperationSiteInfo["InfraController.SaveOperationSiteInfo"]
    InfraController_SaveOperationSiteInfo --> Andromeda_Core_LoggingManager_Error
Detailed Analysis

Key Flows - Summary: Process form data to update location infrastructure and impact statuses based on component and connectivity flags. - Create and populate LocationInfra objects per office ID - Invoke AddOrUpdateInfra with locations and project ID - Update ModifiedDate and collect location infrastructure objects - Update impact model statuses based on flags

Error Flows - Summary: Handle null references and invalid data conversions to prevent runtime exceptions. - Null reference exceptions from unchecked form collection keys - Null reference exceptions from unchecked collections like Coll

Security Issues - Summary: Unsanitized user inputs cause XSS and SQL injection vulnerabilities. - SQL injection and XSS risk from unsanitized inputs in database updates

Performance Issues - Summary: Optimize repeated conversions, string concatenations, and multiple Any() calls on large collections. - Repeated Convert.ToString and Convert.ToDecimal calls on form data, Multiple string concatenations inside loops creating many temporary strings, Repeated LINQ Any() calls on large collections without caching, Any() calls on connectivity list inside loops with large data

Maintainability Issues - Summary: Refactor code to remove magic strings, improve naming, and simplify conditionals. - Use of magic strings reduces maintainability and risks errors, Non-standard variable naming lowers code readability, Fragmented and incomplete code hinders understanding, Repeated method calls cause unnecessary duplication, Complex, lengthy conditionals decrease readability and maintainability

UX Impact Notes - Summary: User experience depends on clear validation, error notifications, and accurate display formatting. - Silent failures in plan creation or status updates harm UX

Test Case Ideas - Summary: Verify SaveOperationSiteInfo correctly updates infrastructure - Call AddOrUpdateInfra with valid and empty Locations collections - Set isBaseCost - Create and populate LocationInfra objects with varied component combinations - Handle all included component flags and their combinations - Update ModifiedDate to current date and time - Update myImpactModel impact status according to flag states

Dependencies & Called Services - Summary: Uses data conversion, collection handling, logging, and multiple domain models. - DateTime conversion, Enumerable operations, Collection interfaces, Domain models: IActorModel, IImpactModel, IInfraModel, IProcessModel, String manipulation - Logging management

CostWizard

Summary: Validate parameters, load project and office data, manage currencies, handle office inclusion logic, load configurations and depreciation, and prepare view data.

ActionResult InfraController.CostWizard(int? CurrentOfficeId, int? ProjectId)

Routing

  • HTTP: GET
  • URL: /Infra/CostWizard
View Metadata
  • View: CostWizard (Andromeda.Web\Views\Infra\CostWizard.cshtml)
  • Model: Tuple<IList<Andromeda.Core.Entities.RefInfraMaster>, Andromeda.Core.Entities.OfficePremise>
Detailed Analysis

Key Flows - Summary: Validate parameters - handle office inclusion logic - Check office inclusion to assign location or redirect - Set office currency from currency list - Populate ViewBag with data collections and return view - Fetch foreign exchange rates and office locations - Load standard configurations and depreciation details, Load connectivity and Citrix details for office and project - Process infrastructure depreciation categories including Systems & Applications - Validate CurrentOfficeId with early return or redirect

Error Flows - Summary: Handle null or invalid inputs and initialize objects to prevent errors. - Early return or redirect on null or invalid CurrentOfficeId

Security Issues - Summary: CostWizard lacks input validation and risks configuration and registry vulnerabilities. - Configuration file vulnerability without proper security, Registry.C usage risks without sanitization or validation, No input parameter validation or security handling

Performance Issues - Summary: CostWizard suffers performance degradation from slow external calls and inefficient data processing. - Expensive LINQ operations on large datasets

Maintainability Issues - Summary: Code contains incomplete segments, unclear naming, magic values, and tight external coupling. - Incomplete or truncated code segments, Typos in identifiers reducing clarity, Use of magic strings and numbers instead of constants, Anonymous types in ViewBag complicate maintenance, Unclear or misspelled variable names, Tight coupling with external dependencies, Incomplete statements causing compilation errors

UX Impact Notes - Summary: Redirects and filtering based on office properties disrupt user workflow and selection options. - Early returns or redirects based on CurrentOfficeId or office properties - Redirects triggered by office inclusion properties like OthersIncluded

Test Case Ideas - Summary: Verify redirects - Fetching and storing foreign exchange rates and office details - Loading standard configurations and depreciation details - Processing infrastructure depreciation categories with special cases - Setting office currency from currency list - Conditional logic for office inclusion affecting location and redirects - Redirects on specific cases and office inclusion conditions

Dependencies & Called Services - Summary: Uses data conversion, collection handling, and infrastructure models. - Data conversion utilities, Enumerable collections, Actor model interface, Collection interface, Infrastructure model interface, Infrastructure components, String operations

CostWizardNewTeam

Summary: Load FX rates, office data, and initialize infrastructure and connectivity with standard configurations.

JsonResult InfraController.CostWizardNewTeam()

Routing

  • HTTP: POST
  • URL: /Infra/CostWizardNewTeam
Detailed Analysis

Key Flows - Summary: Load FX rates, office data, and initialize infrastructure and connectivity with standard configurations. - Initialize LocationInfra and CtrixConnectivity with standard configs, Retrieve and process infrastructure details and new types - Load FX rates, office locations, and details from models

Error Flows - Summary: Handle input validation and database exceptions to prevent runtime errors. - Unhandled database errors in model method calls

Security Issues - Summary: Validate all user inputs and collections to prevent injection and data tampering. - Unvalidated user input converted to integers risking SQL injection and data tampering - Incomplete code handling application settings causing security risks and unexpected behavior

Performance Issues - Summary: Optimize database calls and LINQ usage to prevent performance degradation. - Multiple unoptimized database calls without caching, Excessive LINQ method chaining causing multiple data iterations, Inefficient LINQ Where and Count usage inside loops, Unoptimized iteration over large collections in foreach loops

Maintainability Issues - Summary: Refactor tightly coupled code, replace magic values, and improve naming and clarity. - Tight coupling between controller and model classes, Use of magic strings and numbers instead of constants or enums, Inconsistent and non-descriptive variable naming, Incomplete or misspelled class names and code snippets, Complex and unclear conditional statements, Use of lambda expressions and LINQ queries that reduce readability

UX Impact Notes - Summary: Handles POST requests with conditional user flow based on screen origin. - POST request handling, Conditional user flow based on ScreenFrom variable

Test Case Ideas - and error handling of infrastructure and settings. - Create and initialize LocationInfra and CtrixConnectivity objects - Handle incomplete or truncated code without runtime errors - Load offices, locations, and infrastructure from models, Load and initialize connectivity standard configurations and Ctrix data - Retrieve new infrastructure types with various active ID sets - Access application settings and handle missing or malformed data

Dependencies & Called Services - Summary: Uses data conversion and collection interfaces for infrastructure and actor models. - Data conversion utilities, Enumerable collections, Actor model interface, Collection interfaces, Infrastructure model interface, Infrastructure components, String operations

CostWizardexistingteam

Summary: Load office and currency data for the current project, ensure key currencies exist, update location, and return configuration data.

JsonResult InfraController.CostWizardexistingteam(int? CurrentOfficeId)

Routing

  • HTTP: GET
  • URL: /Infra/CostWizardexistingteam
Detailed Analysis

Key Flows - update location - and return configuration data. - Load office details by project ID and optional office ID, Load office currencies if office exists - Return JsonResult with prepared data - Update current location in registry

Error Flows - Summary: Handle missing office and ensure required currencies are present. - Skip currency loading if office object is null, Add project's default currency if missing, Add 'USD' currency if missing

Performance Issues - Summary: Optimize external calls, string comparisons, and LINQ usage to improve performance. - Uncached multiple external calls for FX rates and office locations, Inefficient StringComparison.CurrentCultureIgnoreCase in currency code comparisons, LINQ Where and ToList causing extra memory allocation and garbage collection

Maintainability Issues - Summary: Fix naming errors, clarify incomplete code, and replace magic strings with constants. - Correct variable name typo from 'currentProjec' to 'currentProject', Clarify incomplete code segments involving 'tId' and 'office' object, Replace magic strings like 'USD' and 'Systems & Applications' with constants or enums

UX Impact Notes - Summary: Including required currencies ensures consistent cost display and smooth user flow. - Avoid early returns or skipped steps to maintain user flow

Test Case Ideas - Summary: Validate JSON output - currency list updates - location updates - Handle empty or pre-populated currency lists - Handle incomplete or malformed 'tId' and office inputs - LoadCurrency returns correct currency list per office - Return expected JsonResult - GetStandardConfigurations returns correct filtered configurations - Update Registry.CurrentLocation after office load

Dependencies & Called Services - Summary: Uses collection interfaces and infrastructure models for data handling and processing. - Enumerable interface, Actor model interface, Collection interface, Infrastructure model interface, Infrastructure class, String type

GetStandardConfigurations

Summary: GetStandardConfigurations loads and filters configurations by infrastructure, calculates quantities, updates properties, and returns the list.

IList<StandardConfiguration> InfraController.GetStandardConfigurations(int officeID, int ProjectID, LocationInfra location)

Routing

  • HTTP: GET
  • URL: /Infra/GetStandardConfigurations
Detailed Analysis

Key Flows - updates properties - and returns the list. - Calculate quantities using formulas - Load all standard configurations - Return processed configuration list - Update RecommendedQuantity and Link properties

Performance Issues - Summary: Optimize LINQ Any calls and reduce repeated method invocations in loops to improve performance. - Inefficient use of LINQ Any with string operations on large datasets - Use of Any() inside loops to check keys in FormulaVa collection

Maintainability Issues - Summary: Replace magic strings with constants and define all variables for clearer, maintainable code. - Use constants instead of magic strings for category IDs and URLs, Define all variables before use, including 'it' and 'FormulaV', Provide complete code context to improve clarity and maintainability

Test Case Ideas - Summary: Verify configuration retrieval, formula handling, quantity calculations, and string processing. - RecommendedQuantity property updates

Dependencies & Called Services - Summary: Uses data conversion and collection utilities with infrastructure model interfaces. - Data conversion utilities, Dictionary and Enumerable collections, Infrastructure calculation model interface, Infrastructure model interface, String operations

saveInfraDetails

Summary: The method decodes and processes infrastructure data, validates selections, updates records, and adjusts project status accordingly.

JsonResult InfraController.saveInfraDetails()

Routing

  • HTTP: POST
  • URL: /Infra/saveInfraDetails

Cross-layer call chain - InfraController.saveInfraDetails → Andromeda.Core.LoggingManager.Error

Call Chain Diagram

flowchart TD
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    InfraController_saveInfraDetails["InfraController.saveInfraDetails"]
    InfraController_saveInfraDetails --> Andromeda_Core_LoggingManager_Error
Detailed Analysis

Key Flows - validates selections - updates records - Iterate and update or delete depreciation and connectivity records - Set flags tracking completion of components and connectivity details - Update project impact and review status based on infrastructure completion - Validate single data-center selection for connectivity

Error Flows - Summary: Handle null references and validate JSON to prevent runtime errors and security issues. - Null reference exceptions in LINQ operations on infraCategories, tabCategories, components, Null reference exceptions during string comparisons with null objects or properties, Lack of validation after JSON deserialization risks errors and security vulnerabilities, Incomplete or malformed code causing runtime errors and unexpected behavior, Ambiguous or unclear method calls causing potential errors

Security Issues - Summary: Fix JSON deserialization vulnerabilities and complete security configurations. - JSON deserialization vulnerabilities from unvalidated input

Performance Issues - Summary: Optimize JSON decoding, LINQ usage, and collection handling to improve performance. - Multiple LINQ calls cause multiple iterations on large datasets - Complex conditional checks inside loops degrade performance

Maintainability Issues - Summary: Refactor code to improve readability, clarity, and reduce duplication. - Use of magic strings reduces readability and maintainability, Incomplete and unclear code snippets hinder understanding, Complex and long conditionals increase error risk, Repeated similar method calls require refactoring, Unclear or ambiguous method calls confuse maintainers, Unclear variable names and incomplete references reduce clarity, Empty or unnecessary code blocks decrease code cleanliness

UX Impact Notes - Summary: Ensures data accuracy but lacks prompts for missing base cost, risking incomplete input. - Prevents multiple data-center selection errors, Risks saving incorrect or incomplete infrastructure details, No prompts for base cost when components are unselected

Test Case Ideas - property updates - conditional logic - status updates - Apply conditional logic based on registry settings and features - Set and reset flags like isBaseCost - Trigger impact and review status updates correctly - Invoke logging and error handling on errors - Handle missing or malformed JSON inputs - Update office ID and project ID on relevant objects - Validate connectivity and data-center selections

Dependencies & Called Services - Summary: Uses data conversion, logging, and model interfaces for infrastructure details saving. - DateTime conversion, Enumerable operations, IImpactModel interface, IInfraModel interface, IProcessModel interface, String manipulation - LoggingManager for logging

Summary

Summary: Retrieve and display infrastructure summaries, update impact statuses, and provide navigation references for the current project and office.

ActionResult InfraController.Summary()

Routing

  • HTTP: GET
  • URL: /Infra/Summary
View Metadata
  • View: Summary (Andromeda.Web\Views\Infra\Summary.cshtml)
  • Model: Tuple<IList<Andromeda.Core.Entities.InfraDetails>, Andromeda.Core.Entities.LocationInfra>
Detailed Analysis

Key Flows - update impact statuses - Set impact status for current project and office - Set complete impact status with navigation URI for current project - Return view with summary list and current location infrastructure

Maintainability Issues - Summary: The method's tight coupling reduces testability and maintainability. - Tight coupling with Registry, Dependency on myModel and myImpactModel instances

UX Impact Notes - Summary: Returns a view that redirects or displays a summary - View return with redirect option

Test Case Ideas - Summary: Verify correct retrieval and setting of summary list and impact status with navigation URI. - Set impact status by project ID and office - Set complete impact status with correct navigation URI

Dependencies & Called Services - Summary: Uses impact and infrastructure models for service dependencies. - IImpactModel dependency, IInfraModel dependency

GettRecommendedQuantity

Summary: The method processes a POST request, decodes configuration, calculates quantity, and returns it as JSON.

JsonResult InfraController.GettRecommendedQuantity()

Routing

  • HTTP: POST
  • URL: /Infra/GettRecommendedQuantity
Detailed Analysis

Key Flows - and returns it as JSON. - Return calculated quantity as JSON result

Error Flows - Summary: The method lacks explicit error handling for input conversion and JSON decoding failures. - Missing error handling for invalid input conversion, Missing error handling for JSON decoding errors

Security Issues - Summary: Unvalidated user input risks SQL injection and XSS vulnerabilities. - Direct use of Request.Form inputs without validation, Potential SQL injection vulnerability, Potential cross-site scripting (XSS) vulnerability

Performance Issues - Summary: Using System.Web.Helpers.Json.Decode degrades performance on large JSON payloads. - Use of System.Web.Helpers.Json.Decode for JSON decoding, Performance degradation with large JSON payloads

Maintainability Issues - Summary: Tight coupling with Registry class hinders testing and maintenance. - Tight coupling with Registry class, Dependency on Registry for project ID and location, Complicated testing and maintenance

UX Impact Notes - Summary: Incorrect recommended quantity calculation degrades user experience. - Incorrect recommended quantity calculation, Negative user experience impact

Test Case Ideas - Summary: Verify HTTP POST handling, correct quantity calculation, and performance with large JSON data. - Assess performance with large JSON in StandardConfig - Calculate quantity with valid project IDs and standard configurations - Handle HTTP POST requests

Dependencies & Called Services - Summary: Convert IInfraCalculationModel for recommended quantity calculation. - Convert IInfraCalculationModel

GettRecommendedQuantityNewLocation

Summary: Decode request data, create infrastructure objects, compute recommended quantity, and return JSON result.

JsonResult InfraController.GettRecommendedQuantityNewLocation()

Routing

  • HTTP: POST
  • URL: /Infra/GettRecommendedQuantityNewLocation
Detailed Analysis

Key Flows - create infrastructure objects - and return JSON result. - Create LocationInfra instance with decoded data - Return computed quantity as JSON response

Error Flows - Summary: Handle JSON decoding errors to prevent runtime exceptions from malformed input. - Missing JSON decoding error handling, Risk of runtime exceptions from malformed input

Security Issues - Summary: Direct JSON deserialization without validation risks security vulnerabilities. - JSON deserialization without input validation, Lack of error handling during JSON decoding

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

Maintainability Issues - Summary: Replace magic strings with named constants to improve code clarity and maintainability. - Use named constants instead of magic strings, Avoid hardcoded configuration keys

UX Impact Notes - Summary: Errors in JSON decoding or quantity calculation cause failures and incorrect results. - JSON decoding errors, Quantity calculation errors, Failures causing incorrect results

Test Case Ideas - Summary: Verify correct Actors assignment - Actors property assignment from decoded data

Dependencies & Called Services - Summary: Uses IInfraCalculationModel for infrastructure-related calculations. - IInfraCalculationModel dependency for calculations

GetProjectCCC

Summary: Retrieve and update project data, calculate costs and metrics, and conditionally process controls and cycle time details.

JsonResult InfraController.GetProjectCCC()

Routing

  • HTTP: GET
  • URL: /Infra/GetProjectCCC

Cross-layer call chain - InfraController.GetProjectCCC → Andromeda.Core.Entities.Activity.Clone - InfraController.GetProjectCCC → Andromeda.Core.Entities.Arrow.Clone - InfraController.GetProjectCCC → Andromeda.Core.Services.ProcessExtensions.FindByID - InfraController.GetProjectCCC → Andromeda.Core.Services.Algorithms.Delooper.deloop - InfraController.GetProjectCCC → Andromeda.Core.Extensions.LinqExtensions.CurrencyConverter - InfraController.GetProjectCCC → Andromeda.Core.Services.Algorithms.Delooper.GetLoopingArrows - InfraController.GetProjectCCC → Insorce.Helpers.Helpers.DaysConverter - InfraController.GetProjectCCC → Andromeda.Core.Services.Algorithms.Delooper.GetSourcesAndSinks - Andromeda.Core.Services.Algorithms.Delooper.deloop → Andromeda.Core.LoggingManager.Error - Andromeda.Core.Services.Algorithms.Delooper.deloop → Andromeda.Core.Services.ProcessExtensions.FindByID - Andromeda.Core.Extensions.LinqExtensions.CurrencyConverter → Andromeda.Core.Extensions.LinqExtensions.CurrencyConverter - Insorce.Helpers.Helpers.DaysConverter → Andromeda.Core.Extensions.LinqExtensions.DaysConverter - Andromeda.Core.Services.Algorithms.Delooper.GetSourcesAndSinks → Andromeda.Core.Services.ProcessExtensions.FindByID - Andromeda.Core.Services.Algorithms.Delooper.GetSourcesAndSinks → Andromeda.Core.Extensions.LinqExtensions.GetPathIds

Call Chain Diagram

flowchart TD
    Andromeda_Core_Entities_Activity_Clone["Andromeda.Core.Entities.Activity.Clone"]
    Andromeda_Core_Entities_Arrow_Clone["Andromeda.Core.Entities.Arrow.Clone"]
    Andromeda_Core_Extensions_LinqExtensions_CurrencyConverter["Andromeda.Core.Extensions.LinqExtensions.CurrencyConverter"]
    Andromeda_Core_Extensions_LinqExtensions_DaysConverter["Andromeda.Core.Extensions.LinqExtensions.DaysConverter"]
    Andromeda_Core_Extensions_LinqExtensions_GetPathIds["Andromeda.Core.Extensions.LinqExtensions.GetPathIds"]
    Andromeda_Core_LoggingManager_Error["Andromeda.Core.LoggingManager.Error"]
    Andromeda_Core_Services_Algorithms_Delooper_GetLoopingArrows["Andromeda.Core.Services.Algorithms.Delooper.GetLoopingArrows"]
    Andromeda_Core_Services_Algorithms_Delooper_GetSourcesAndSinks["Andromeda.Core.Services.Algorithms.Delooper.GetSourcesAndSinks"]
    Andromeda_Core_Services_Algorithms_Delooper_deloop["Andromeda.Core.Services.Algorithms.Delooper.deloop"]
    Andromeda_Core_Services_ProcessExtensions_FindByID["Andromeda.Core.Services.ProcessExtensions.FindByID"]
    InfraController_GetProjectCCC["InfraController.GetProjectCCC"]
    Insorce_Helpers_Helpers_DaysConverter["Insorce.Helpers.Helpers.DaysConverter"]
    Andromeda_Core_Extensions_LinqExtensions_CurrencyConverter --> Andromeda_Core_Extensions_LinqExtensions_CurrencyConverter
    Andromeda_Core_Services_Algorithms_Delooper_GetSourcesAndSinks --> Andromeda_Core_Extensions_LinqExtensions_GetPathIds
    Andromeda_Core_Services_Algorithms_Delooper_GetSourcesAndSinks --> Andromeda_Core_Services_ProcessExtensions_FindByID
    Andromeda_Core_Services_Algorithms_Delooper_deloop --> Andromeda_Core_LoggingManager_Error
    Andromeda_Core_Services_Algorithms_Delooper_deloop --> Andromeda_Core_Services_ProcessExtensions_FindByID
    InfraController_GetProjectCCC --> Andromeda_Core_Entities_Activity_Clone
    InfraController_GetProjectCCC --> Andromeda_Core_Entities_Arrow_Clone
    InfraController_GetProjectCCC --> Andromeda_Core_Extensions_LinqExtensions_CurrencyConverter
    InfraController_GetProjectCCC --> Andromeda_Core_Services_Algorithms_Delooper_GetLoopingArrows
    InfraController_GetProjectCCC --> Andromeda_Core_Services_Algorithms_Delooper_GetSourcesAndSinks
    InfraController_GetProjectCCC --> Andromeda_Core_Services_Algorithms_Delooper_deloop
    InfraController_GetProjectCCC --> Andromeda_Core_Services_ProcessExtensions_FindByID
    InfraController_GetProjectCCC --> Insorce_Helpers_Helpers_DaysConverter
    Insorce_Helpers_Helpers_DaysConverter --> Andromeda_Core_Extensions_LinqExtensions_DaysConverter
Detailed Analysis

Key Flows - Summary: Retrieve and update project data - Calculate action costs in USD using exchange rates, Calculate HR, infrastructure, and actor costs with active actor filtering - Retrieve project data including actors, activities, arrows, products, infrastructure, Conditionally retrieve and process control and risk data with effectiveness and detail calculations, Conditionally calculate cycle time and volume metrics, Aggregate and round metrics like control coverage, adequacy benefit, and effectiveness benefit - Update infrastructure data with master and location details via LINQ

Error Flows - Summary: Handle null references in project IDs - Null reference risks in Registry.CurrentProjectId and model instances, Null reference risks in InfraMasterData and OfficeList collections, Null reference risks in Request parameters like 'Controls' and 'Cycletime', Incomplete code causing runtime errors or unexpected behavior

Security Issues - Summary: Sanitize user input to prevent SQL injection in GetProjectCCC. - SQL injection risk from unsanitized Request["Controls"] input

Performance Issues - Summary: Excessive repeated enumerations and lack of caching degrade performance on large data sets. - Multiple ToList() calls on large data sets causing high memory usage

Maintainability Issues - Summary: Refactor GetProjectCCC to improve readability, reduce complexity, and remove unclear code. - High complexity from many method calls, data transformations, and nested LINQ queries, Use of magic strings and numbers reduces readability and configurability, Repeated CurrencyConverter calls without caching complicate maintenance, Anonymous objects usage hinders code clarity, Incomplete and truncated code segments degrade quality, Non-descriptive variable names reduce readability, Lambda expressions lack explicit typing, Commented-out code confuses maintainers and should be removed

UX Impact Notes - Summary: Backend data retrieval affects UX only through performance and data accuracy. - No direct user experience impact, Performance issues cause slow or incorrect data affecting workflows

Test Case Ideas - Summary: Validate data updates - Calculate HR, infrastructure, and actor costs accurately - Filter and aggregate risk and objective data efficiently on large datasets - Handle edge cases with zero or negative volume and cost values - Update infraMaster and infraLocation fields including empty data

Dependencies & Called Services - Summary: Uses multiple models, collections, and utility classes for project data processing. - Activity service, Arrow service, Convert utility, Enumerable collections, Helpers utility, IActorModel interface, IControlModel interface, IHRModel interface, IInfraModel interface, IProcessModel interface, IRiskModel interface, Int32 type, LinqExtensions utility, List collection, Math utility, String type - ProcessExtensions utility

UpdateLocationSplit

Summary: UpdateLocationSplit processes location data from the form, updates office and team IDs, and manages location office data accordingly.

JsonResult InfraController.UpdateLocationSplit()

Routing

  • HTTP: POST
  • URL: /Infra/UpdateLocationSplit
Detailed Analysis

Key Flows - Summary: UpdateLocationSplit processes location data from the form - updates office and team IDs - Check presence of LocationData in form - Create new office entry if officeId is zero and teamIDs not empty - Decode JSON from LocationD field and iterate locations, Clear deleted location office data if teams cleared, Add default team ID if teamIDs empty and mark teams cleared - Update team office IDs for officeId > 0 - Update location office data using current project ID

Error Flows - Summary: Handle null references - Null reference risks from Request.Form or LocationData, Exceptions from invalid office ID integer conversions, JSON deserialization errors from malformed LocationD field, Compilation errors from incomplete or malformed code

Security Issues - Summary: Fix JSON deserialization vulnerability and prevent data exposure from incomplete code. - JSON deserialization vulnerability in 'LocationD' decoding, Data exposure risk from incomplete method calls and code snippets

Performance Issues - Summary: Optimize repeated ClearDeletedLocationOfficeData calls and reduce unnecessary list creation. - Repeated ClearDeletedLocationOfficeData calls without caching, Unnecessary creation of new and unused empty lists in loops

Maintainability Issues - Summary: Incomplete code, unclear names, magic strings, tight coupling, and unsafe casts reduce maintainability. - Incomplete code snippets and missing parentheses, Use of magic strings instead of constants, Unclear and incomplete variable names, Tight coupling with internal methods, Casting and type conversions without validation

UX Impact Notes - Summary: Display of update location split depends on presence of LocationData in form. - Conditional display of update location split

Test Case Ideas - Summary: Verify UpdateLocationSplit handles input variations - Create new office when officeId is zero and teamIDs not empty - Handle empty and non-empty teamIDs - Handle missing LocationData in form - Return JsonResult - Call UpdateTeamOfficeId with correct parameters - Evaluate performance with large data sets

Dependencies & Called Services - Summary: Convert IActorModel list for location split update. - Convert IActorModel list