CWE::Weakness
Inherits Comparable < Reference < Object
A single CWE entry.
Instances are constructed once when the embedded catalog is loaded
(CWE::Catalog) and are then immutable. All accessors are pure reads
over the parsed data — no I/O happens after the initial load.
w = CWE.find!("CWE-79")
w.name # => "Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')"
w.abstraction # => CWE::Abstraction::Base
w.parents.map(&.cwe_id) # => [74]
Constructors
Instance methods
Compares this object to other based on the receiver’s <=> method,
returning true if it returns 0.
Also returns true if this and other are the same object.
Edges of the form ParentOf — children that point back at this entry.
Note that the MITRE CSV usually expresses the relationship from the
child's side, so use Catalog#children_of for a complete answer.
Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>
True when MITRE marks this entry as an acceptable mapping target
(Allowed or Allowed-with-Review).
CWE 4.x mapping policy. MappingUsage::Other is returned when the
entry has no <Mapping_Notes> block (older entries; categories that
predate the policy).
Raw fields kept for the catalog's internal use; not part of the public surface but exposed for callers that want to introspect the underlying representation.
Single-line summary suitable for log lines / CLI output:
"CWE-79: Improper Neutralization of Input ... (Base, Stable)".
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>