Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Code Metrics Assessment in C#New to Visual Studio Code? Get it now.
Code Metrics Assessment in C#

Code Metrics Assessment in C#

Christell Ann Mataac

|
2,172 installs
| (0) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Code Metrics Assessment in C#

This extension will evaluate and record the metrics processed on the duration of your C# coding

Features

Upon the completion of exercise, the extension will provide you information regarding to your coding metrics such as:

  • Time taken to finish the exercise

(From the Text Editor)

  • Count of Cyclomatic Complexity (CC)
  • Lines of Codes (LOC)
  • Count of complicated codes (i.e. which can be simplified in ternary operators)
  • Count of unused variables

(From the Console Log terminal output)

  • Name of distinct errors encountered
  • Number of distinct errors encountered
  • Total number of errors encountered

Pre-requisite to get started

  • Must have .Net Core SDK installed on the machine to enable the running and debugging of your C# code

Programming language applicable

  • C#

Commands available

  • C# Assessment: Initialise Extension – this will enable the usage of extension
  • C# Assessment: Disable Extension – this will disable the usage of extension
  • C# Assessment: Start Exercise – this will begin the exercise recording
  • C# Assessment: Finish Exercise – this will end the exercise recording, process the metrics, and save and display the processed results afterwards

How to use

  • Open Visual Studio Code and install the Code Metrics Assessment in C# extension

    • upon installation, this will automatically create the necessary folder used in the process (i.e., current-exercise and result)
  • Update the created activity_details.txt file and input the neccessary exercise information

    • This file is located in the default .vscode folder that was automatically created upon the installation of the Visual Studio Code application

    \\.vscode\extensions\christellannmataac.studentassessment...\out\student-assessment\current-exercise\activity_details.txt

    • The .vscode folder is typically located at the C:\Users\[machine-name]\.vscode
  • Return to Visual Studio Code and begin the exercise

    • Use Ctrl + Shift + P (Windows) / Shift + Command + P (MacOS) shortcut and write C# Assessment: Start Exercise then execute.
    • For first usage, a Consent Form will display requiring for your approval to allow the extension do the metrics processing. The form can be triggered by calling C# Assessment: Initialise Extension
  • START WITH YOUR NORMAL CODING... (e.g. create new C# project, code, test and debug)

    • Note: Make sure you stay on the same window as closing this will end the session
  • Once finished with the coding and satisfied with result, end the exercise

    • Use Ctrl + Shift + P (Windows) / Shift + Command + P (MacOS) shortcut and write C# Assessment: Finish Exercise then execute
    • Note: The last run made on the program (that are displayed in the console log terminal) and the open text editor utilised for coding will be the one to use in the metrics processing. So make sure to run and save the file before calling the finish command.
  • Wait for the evaluation to finish

    • Information alert will appear confirming the status of the process (this will typically around 10-15 seconds)
  • An immediate view result will appear after the processing

    • You can also check the processed file for the specific exercise specified on the view
  • Ta-dah. You have now your metrics!

Note

You can do the same exercise multiple times!

  • Note: make sure to have the correct activity_exercise.txt information on the current-exercise folder before and after doing the activity

With doing the exercise multiple times, you can track your progress and compare from the previous practices made. A summary.csv file that contains all the result of practices for each exercise is also available for viewing. This will give you a one document view to see your progression in the specific activity over the time of coding

Limitation of the metrics

  • Count of complicated codes (i.e. which can be simplified in ternary operators)
    • can only trigger the single conditions; for future improvement
  • Count of unused variables
    • can only check the simple variable declarations; for future improvement

Release Notes

1.0.0

Initial completed prototype.

2.0.0

Contains the bug fixes and enhancements gathered from prototype 1

2.0.4

Latest release

  • contains minor improvements from prototype 2
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft