java.lang.Object
edu.hm.hafner.analysis.Issue
Alle implementierten Schnittstellen:
Serializable

public class Issue extends Object implements Serializable
An issue reported by a static analysis tool. Use the provided builder to create new instances.
Autor:
Ullrich Hafner
Siehe auch:
  • Methodendetails

    • getPropertyValueAsString

      public static String getPropertyValueAsString(Issue issue, String propertyName)
      Returns the value of the property with the specified name for a given issue instance.
      Parameter:
      issue - the issue to get the property for
      propertyName - the name of the property
      Gibt zurück:
      the function that obtains the value
    • getPropertyValueGetter

      public static Function<Issue,String> getPropertyValueGetter(String propertyName)
      Returns a function that can dynamically obtain the value of the property with the specified name of an issue instance.
      Parameter:
      propertyName - the name of the property
      Gibt zurück:
      the function that obtains the value
    • byPackageName

      public static Predicate<Issue> byPackageName(String packageName)
      Returns a predicate that checks if the package name of an issue is equal to the specified package name.
      Parameter:
      packageName - the package name to match
      Gibt zurück:
      the predicate
    • byModuleName

      public static Predicate<Issue> byModuleName(String moduleName)
      Returns a predicate that checks if the module name of an issue is equal to the specified module name.
      Parameter:
      moduleName - the module name to match
      Gibt zurück:
      the predicate
    • byFileName

      public static Predicate<Issue> byFileName(String fileName)
      Returns a predicate that checks if the file name of an issue is equal to the specified file name.
      Parameter:
      fileName - the file name to match
      Gibt zurück:
      the predicate
    • byFolder

      public static Predicate<Issue> byFolder(String folder)
      Returns a predicate that checks if the folder of an issue is equal to the specified folder.
      Parameter:
      folder - the folder to match
      Gibt zurück:
      the predicate
    • bySeverity

      public static Predicate<Issue> bySeverity(Severity severity)
      Returns a predicate that checks if the severity of an issue is equal to the specified severity.
      Parameter:
      severity - the severity to match
      Gibt zurück:
      the predicate
    • byCategory

      public static Predicate<Issue> byCategory(String category)
      Returns a predicate that checks if the category of an issue is equal to the specified category.
      Parameter:
      category - the category to match
      Gibt zurück:
      the predicate
    • byOrigin

      public static Predicate<Issue> byOrigin(String origin)
      Returns a predicate that checks if the origin of an issue is equal to the specified origin.
      Parameter:
      origin - the origin to match
      Gibt zurück:
      the predicate
    • byType

      public static Predicate<Issue> byType(String type)
      Returns a predicate that checks if the type of an issue is equal to the specified type.
      Parameter:
      type - the type to match
      Gibt zurück:
      the predicate
    • readResolve

      protected Object readResolve()
      Called after de-serialization to improve the memory usage.
      Gibt zurück:
      this
    • getId

      public UUID getId()
      Returns the unique ID of this issue.
      Gibt zurück:
      the unique ID
    • getFileName

      public String getFileName()
      Returns the name of the affected file. This file name is a path relative to the path of the affected files (returned by getPath()).
      Gibt zurück:
      the name of the file that contains this issue
      Siehe auch:
    • getFolder

      public String getFolder()
      Returns the folder that contains the affected file of this issue. Note that this path is not an absolute path, it is relative to the path of the affected files (returned by getPath()).
      Gibt zurück:
      the folder of the file that contains this issue
    • getBaseName

      public String getBaseName()
      Returns the base name of the file that contains this issue (i.e. the file name without the full path).
      Gibt zurück:
      the base name of the file that contains this issue
    • getAbsolutePath

      public String getAbsolutePath()
      Returns the absolute path of the affected file.
      Gibt zurück:
      the base name of the file that contains this issue
    • getPath

      public String getPath()
      Returns the path of the affected file. Note that this path is not the parent folder of the affected file. This path is the folder that contains all of the affected files of a Report. If this path is not defined, then the default value UNDEFINED is returned.
      Gibt zurück:
      the base name of the file that contains this issue
    • hasFileName

      public boolean hasFileName()
      Returns whether this issue has a file name set.
      Gibt zurück:
      true if this issue has a file name set
      Siehe auch:
    • getCategory

      public String getCategory()
      Returns the category of this issue (depends on the available categories of the static analysis tool). Examples for categories are "Deprecation", "Design", or "JavaDoc".
      Gibt zurück:
      the category
    • getType

      public String getType()
      Returns the type of this issue (depends on the available types of the static analysis tool). The type typically is the associated rule of the static analysis tool that reported this issue.
      Gibt zurück:
      the type
    • getSeverity

      public Severity getSeverity()
      Returns the severity of this issue.
      Gibt zurück:
      the severity
    • getMessage

      public String getMessage()
      Returns the detailed message for this issue.
      Gibt zurück:
      the message
    • getDescription

      public String getDescription()
      Returns an additional description for this issue. Static analysis tools might provide some additional information about this issue. This description may contain valid HTML.
      Gibt zurück:
      the description
    • getLineStart

      public int getLineStart()
      Returns the first line of this issue (lines start at 1; 0 indicates the whole file).
      Gibt zurück:
      the first line
    • getLineEnd

      public int getLineEnd()
      Returns the last line of this issue (lines start at 1).
      Gibt zurück:
      the last line
    • getLineRanges

      public Iterable<? extends LineRange> getLineRanges()
      Returns additional line ranges for this issue. Not that the primary range given by lineStart and lineEnd is not included.
      Gibt zurück:
      the last line
    • getColumnStart

      public int getColumnStart()
      Returns the first column of this issue (columns start at 1, 0 indicates the whole line).
      Gibt zurück:
      the first column
    • getColumnEnd

      public int getColumnEnd()
      Returns the last column of this issue (columns start at 1).
      Gibt zurück:
      the last column
    • getPackageName

      public String getPackageName()
      Returns the name of the package or name space (or similar concept) that contains this issue.
      Gibt zurück:
      the package name
    • hasPackageName

      public boolean hasPackageName()
      Returns whether this issue has a package name set.
      Gibt zurück:
      true if this issue has a package name set
      Siehe auch:
    • getModuleName

      public String getModuleName()
      Returns the name of the module or project (or similar concept) that contains this issue.
      Gibt zurück:
      the module
    • hasModuleName

      public boolean hasModuleName()
      Returns whether this issue has a module name set.
      Gibt zurück:
      true if this issue has a module name set
      Siehe auch:
    • getOrigin

      public String getOrigin()
      Returns the ID of the tool that did report this issue.
      Gibt zurück:
      the ID of the origin
    • getOriginName

      public String getOriginName()
      Returns the name of the tool that did report this issue.
      Gibt zurück:
      the name of the origin
    • setOrigin

      public void setOrigin(String origin)
      Sets the ID of the tool that did report this issue.
      Parameter:
      origin - the origin
    • setOrigin

      public void setOrigin(String originId, String name)
      Sets the ID and the name of the tool that did report this issue.
      Parameter:
      originId - the ID of the origin
      name - the name of the origin
    • getReference

      public String getReference()
      Returns a reference to the execution of the static analysis tool (build ID, timestamp, etc.).
      Gibt zurück:
      the reference
    • setReference

      public void setReference(@CheckForNull String reference)
      Sets a reference to the execution of the static analysis tool (build ID, timestamp, etc.). This property should not be set by parsers as it is overwritten by the differencing engine while computing new and fixed issues.
      Parameter:
      reference - the reference
    • getFingerprint

      public String getFingerprint()
      Returns the fingerprint for this issue. Used to decide if two issues are equal even if the equals method returns false since some of the properties differ due to code refactorings. The fingerprint is created by analyzing the content of the affected file.

      Note: the fingerprint is not part of the equals method since the fingerprint might change due to an unrelated refactoring of the source code.

      Gibt zurück:
      the fingerprint of this issue
    • hasFingerprint

      public boolean hasFingerprint()
      Returns whether this issue already has a fingerprint set.
      Gibt zurück:
      true if this issue already has a fingerprint set
    • getAdditionalProperties

      @CheckForNull public Serializable getAdditionalProperties()
      Returns additional properties for this issue. A static analysis tool may store additional properties in this untyped object. This object will be serialized and is used in equals and hashCode.
      Gibt zurück:
      the additional properties
    • equals

      public boolean equals(@CheckForNull Object o)
      Setzt außer Kraft:
      equals in Klasse Object
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object