Record Class TypeInferenceTelemetry

java.lang.Object
java.lang.Record
org.sonar.plugins.python.telemetry.collectors.TypeInferenceTelemetry
Record Components:
totalNames - Total number of Name nodes in all analyzed trees
unknownTypeNames - Number of Names with the UNKNOWN type
unresolvedImportTypeNames - Number of Names with an UnresolvedImportType
totalImports - Total number of imported items (from both import and from...import statements)
importsWithUnknownType - Number of imports that resolve to UNKNOWN or UnresolvedImportType
uniqueSymbols - Number of unique symbols (using symbolsV2)
unknownSymbols - Number of unique symbols which are unknown

public record TypeInferenceTelemetry(long totalNames, long unknownTypeNames, long unresolvedImportTypeNames, long totalImports, long importsWithUnknownType, long uniqueSymbols, long unknownSymbols) extends Record
Telemetry data for type inference quality metrics.
  • Constructor Details

    • TypeInferenceTelemetry

      public TypeInferenceTelemetry(long totalNames, long unknownTypeNames, long unresolvedImportTypeNames, long totalImports, long importsWithUnknownType, long uniqueSymbols, long unknownSymbols)
      Creates an instance of a TypeInferenceTelemetry record class.
      Parameters:
      totalNames - the value for the totalNames record component
      unknownTypeNames - the value for the unknownTypeNames record component
      unresolvedImportTypeNames - the value for the unresolvedImportTypeNames record component
      totalImports - the value for the totalImports record component
      importsWithUnknownType - the value for the importsWithUnknownType record component
      uniqueSymbols - the value for the uniqueSymbols record component
      unknownSymbols - the value for the unknownSymbols record component
  • Method Details

    • empty

      public static TypeInferenceTelemetry 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.
    • totalNames

      public long totalNames()
      Returns the value of the totalNames record component.
      Returns:
      the value of the totalNames record component
    • unknownTypeNames

      public long unknownTypeNames()
      Returns the value of the unknownTypeNames record component.
      Returns:
      the value of the unknownTypeNames record component
    • unresolvedImportTypeNames

      public long unresolvedImportTypeNames()
      Returns the value of the unresolvedImportTypeNames record component.
      Returns:
      the value of the unresolvedImportTypeNames record component
    • totalImports

      public long totalImports()
      Returns the value of the totalImports record component.
      Returns:
      the value of the totalImports record component
    • importsWithUnknownType

      public long importsWithUnknownType()
      Returns the value of the importsWithUnknownType record component.
      Returns:
      the value of the importsWithUnknownType record component
    • uniqueSymbols

      public long uniqueSymbols()
      Returns the value of the uniqueSymbols record component.
      Returns:
      the value of the uniqueSymbols record component
    • unknownSymbols

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