Skip to main content
All CollectionsWeCP AI Copilot
List of Code quality metrics that WeCP measures
List of Code quality metrics that WeCP measures

This guide would help you understand how WeCP evaluates code quality through different metrics like maintainability, reliability and more.

The WeCP Team avatar
Written by The WeCP Team
Updated over a week ago

Note: This feature is powered by WeCP AI, currently in beta — experience the full functionality on January 1, 2025!

WeCP’s platform is designed to ensure that your candidates write high-quality, maintainable, and efficient code. By analyzing various aspects of code quality, WeCP provides detailed insights into candidates' coding skills, helping you make data-driven decisions. Below is the comprehensive list of code quality metrics that WeCP measures during assessments.


1. Maintainability Metrics

a. Cyclomatic Complexity

  • What it Measures: The number of independent paths in a codebase.

  • Why It Matters: Lower complexity indicates simpler, more maintainable code.

  • How WeCP Helps: Our platform evaluates complexity to identify overly complicated or error-prone code.

b. Lines of Code (LOC)

  • What it Measures: The total number of lines in the submitted code.

    • Source Lines of Code (SLOC): Actual executable lines.

    • Comment Lines of Code (CLOC): Lines containing comments.

  • Why It Matters: Helps assess verbosity and the balance between comments and code.

c. Maintainability Index

  • What it Measures: The overall ease of maintaining the codebase.

  • Why It Matters: Higher scores reflect cleaner, maintainable code.

  • How WeCP Helps: The platform computes and displays the maintainability index for each submission.


2. Readability Metrics

a. Code Readability Index

  • What it Measures: The ease with which the code can be read and understood.

  • Why It Matters: Improves collaboration and future code modifications.

  • How WeCP Helps: Analyzes indentation, naming conventions, and structure.

b. Code Documentation Coverage

  • What it Measures: The percentage of code with inline comments or external documentation.

  • Why It Matters: Ensures the code is understandable for future developers.

  • How WeCP Helps: Highlights well-documented submissions.


3. Performance Metrics

a. Execution Time

  • What it Measures: The time taken for the code to execute specific tasks.

  • Why It Matters: Ensures solutions are optimized for real-world scenarios.

  • How WeCP Helps: Measures time for all test cases, including edge cases.

b. Memory Usage

  • What it Measures: The amount of memory consumed during execution.

  • Why It Matters: Efficient memory usage prevents performance bottlenecks.

  • How WeCP Helps: Tracks memory allocation and flags inefficiencies.

c. Algorithmic Efficiency

  • What it Measures: Time and space complexity of the implemented solution.

  • Why It Matters: Optimized algorithms handle larger datasets effectively.

  • How WeCP Helps: Reports on efficiency using Big-O notation.


4. Reliability Metrics

a. Defect Density

  • What it Measures: The number of errors or failures per 1,000 lines of code (KLOC).

  • Why It Matters: Identifies areas prone to bugs or defects.

  • How WeCP Helps: Automatically flags test case failures to calculate this metric.


5. Testability Metrics

a. Code Coverage

  • What it Measures: The percentage of code executed during test cases.

    • Statement Coverage: Verifies all code statements are tested.

    • Branch Coverage: Ensures all conditional branches are executed.

  • Why It Matters: Identifies untested portions of code.

  • How WeCP Helps: Tracks and reports coverage automatically during assessments.

b. Test Case Success Rate

  • What it Measures: The percentage of test cases that pass for a given solution.

  • Why It Matters: Reflects how robust the solution is.

  • How WeCP Helps: Displays detailed results for each test case.


6. Reusability Metrics

a. Coupling

  • What it Measures: Dependencies between modules or components in the code.

  • Why It Matters: Lower coupling improves modularity and reusability.

  • How WeCP Helps: Flags tightly coupled code.

b. Cohesion

  • What it Measures: The degree to which functionalities in a module are related.

  • Why It Matters: High cohesion leads to better maintainability.

  • How WeCP Helps: Evaluates modules for cohesive design.


7. Security Metrics

a. Static Code Analysis

  • What it Measures: Potential vulnerabilities and coding violations.

  • Why It Matters: Identifies security risks early.

  • How WeCP Helps: Integrates static analysis tools to detect vulnerabilities.


8. Consistency Metrics

a. Code Duplication

  • What it Measures: The percentage of duplicate code within submissions.

  • Why It Matters: Lower duplication enhances maintainability and efficiency.

  • How WeCP Helps: Flags redundant code automatically.

b. Coding Standard Compliance

  • What it Measures: Adherence to programming standards (e.g., PEP8 for Python).

  • Why It Matters: Promotes consistency and best practices.

  • How WeCP Helps: Provides detailed feedback on coding standard violations.


9. Scalability Metrics

a. Load Testing

  • What it Measures: How well the solution handles large datasets.

  • Why It Matters: Ensures the code is ready for production-level challenges.

  • How WeCP Helps: Simulates large inputs during testing.

b. Fault Tolerance

  • What it Measures: The ability of the code to handle unexpected conditions gracefully.

  • Why It Matters: Prevents system crashes in real-world applications.

  • How WeCP Helps: Tests for edge cases and unexpected inputs.


10. Developer Productivity Metrics

a. Time to Solution

  • What it Measures: The time taken to complete the assessment.

  • Why It Matters: Reflects coding efficiency and time management.

  • How WeCP Helps: Automatically tracks candidate submission time.


Conclusion

WeCP's comprehensive analysis of these code quality metrics ensures that candidates are evaluated not just on functional correctness but also on their ability to write high-quality, maintainable, and efficient code. By leveraging these insights, you can identify the best-fit candidates for your technical roles. For more information, contact our support team via intercom chat.

Did this answer your question?