Record Class TestFileTelemetry

java.lang.Object
java.lang.Record
org.sonar.plugins.python.telemetry.collectors.TestFileTelemetry
Record Components:
totalMainFiles - Total number of files classified as MAIN
importBasedMisclassifiedTestFiles - Number of MAIN files that appear to be test files based on import heuristic (import unittest/pytest or follow pytest patterns)
totalLines - Total number of lines across all files (MAIN + TEST)
totalMainLines - Total number of lines across all MAIN files
testLines - Number of lines across all TEST files (as classified by the scanner engine)
importBasedMisclassifiedTestLines - Number of lines across import-based misclassified test files (subset of totalMainLines)
pathBasedMisclassifiedTestFiles - Number of MAIN files that appear to be test files based on path heuristic (contains "test" or "tests" in path)
pathBasedMisclassifiedTestLines - Number of lines across path-based misclassified test files
filesInImportBasedOnly - Number of files detected by import-based heuristic but not by path-based heuristic
filesInPathBasedOnly - Number of files detected by path-based heuristic but not by import-based heuristic
linesInImportBasedOnly - Number of lines in files detected by import-based heuristic but not by path-based heuristic
linesInPathBasedOnly - Number of lines in files detected by path-based heuristic but not by import-based heuristic

public record TestFileTelemetry(long totalMainFiles, long importBasedMisclassifiedTestFiles, long totalLines, long totalMainLines, long testLines, long importBasedMisclassifiedTestLines, long pathBasedMisclassifiedTestFiles, long pathBasedMisclassifiedTestLines, long filesInImportBasedOnly, long filesInPathBasedOnly, long linesInImportBasedOnly, long linesInPathBasedOnly) extends Record
Telemetry data for tracking test file misclassification.
  • Constructor Details

    • TestFileTelemetry

      public TestFileTelemetry(long totalMainFiles, long importBasedMisclassifiedTestFiles, long totalLines, long totalMainLines, long testLines, long importBasedMisclassifiedTestLines, long pathBasedMisclassifiedTestFiles, long pathBasedMisclassifiedTestLines, long filesInImportBasedOnly, long filesInPathBasedOnly, long linesInImportBasedOnly, long linesInPathBasedOnly)
      Creates an instance of a TestFileTelemetry record class.
      Parameters:
      totalMainFiles - the value for the totalMainFiles record component
      importBasedMisclassifiedTestFiles - the value for the importBasedMisclassifiedTestFiles record component
      totalLines - the value for the totalLines record component
      totalMainLines - the value for the totalMainLines record component
      testLines - the value for the testLines record component
      importBasedMisclassifiedTestLines - the value for the importBasedMisclassifiedTestLines record component
      pathBasedMisclassifiedTestFiles - the value for the pathBasedMisclassifiedTestFiles record component
      pathBasedMisclassifiedTestLines - the value for the pathBasedMisclassifiedTestLines record component
      filesInImportBasedOnly - the value for the filesInImportBasedOnly record component
      filesInPathBasedOnly - the value for the filesInPathBasedOnly record component
      linesInImportBasedOnly - the value for the linesInImportBasedOnly record component
      linesInPathBasedOnly - the value for the linesInPathBasedOnly record component
  • Method Details

    • empty

      public static TestFileTelemetry empty()
    • add

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • totalMainFiles

      public long totalMainFiles()
      Returns the value of the totalMainFiles record component.
      Returns:
      the value of the totalMainFiles record component
    • importBasedMisclassifiedTestFiles

      public long importBasedMisclassifiedTestFiles()
      Returns the value of the importBasedMisclassifiedTestFiles record component.
      Returns:
      the value of the importBasedMisclassifiedTestFiles record component
    • totalLines

      public long totalLines()
      Returns the value of the totalLines record component.
      Returns:
      the value of the totalLines record component
    • totalMainLines

      public long totalMainLines()
      Returns the value of the totalMainLines record component.
      Returns:
      the value of the totalMainLines record component
    • testLines

      public long testLines()
      Returns the value of the testLines record component.
      Returns:
      the value of the testLines record component
    • importBasedMisclassifiedTestLines

      public long importBasedMisclassifiedTestLines()
      Returns the value of the importBasedMisclassifiedTestLines record component.
      Returns:
      the value of the importBasedMisclassifiedTestLines record component
    • pathBasedMisclassifiedTestFiles

      public long pathBasedMisclassifiedTestFiles()
      Returns the value of the pathBasedMisclassifiedTestFiles record component.
      Returns:
      the value of the pathBasedMisclassifiedTestFiles record component
    • pathBasedMisclassifiedTestLines

      public long pathBasedMisclassifiedTestLines()
      Returns the value of the pathBasedMisclassifiedTestLines record component.
      Returns:
      the value of the pathBasedMisclassifiedTestLines record component
    • filesInImportBasedOnly

      public long filesInImportBasedOnly()
      Returns the value of the filesInImportBasedOnly record component.
      Returns:
      the value of the filesInImportBasedOnly record component
    • filesInPathBasedOnly

      public long filesInPathBasedOnly()
      Returns the value of the filesInPathBasedOnly record component.
      Returns:
      the value of the filesInPathBasedOnly record component
    • linesInImportBasedOnly

      public long linesInImportBasedOnly()
      Returns the value of the linesInImportBasedOnly record component.
      Returns:
      the value of the linesInImportBasedOnly record component
    • linesInPathBasedOnly

      public long linesInPathBasedOnly()
      Returns the value of the linesInPathBasedOnly record component.
      Returns:
      the value of the linesInPathBasedOnly record component