# US 2025/0225014 A1 · System and method for prioritizing code violations using machine learning and datasets of vulnerable and vanilla code snippets

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0225014 A1
- Document ID: US20250225014A1
- Status: Published application
- Kind: A1
- Application number: 18/952,700
- Filed: 2024-11-19
- Published: 2025-07-10
- Earliest claimed: 2024-01-08
- Assignees: Parasoft Corporation
- Applicants: Parasoft Corporation
- Inventors: Leszek Jerzy Raszka; Mariusz Woloszyn
- Web page: https://patentgrep.com/patent/US20250225014A1

## CPC

- G06F 11/0766: {Error or fault reporting or storing}
- G06F 11/3604: Analysis of software for verifying properties of programs (testing of software G06F11/3668)
- G06F 21/563: {by source code analysis}
- G06F 21/577: {Assessing vulnerabilities and evaluating computer system security}
- G06F 2221/033: Test or assess software
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Method for prioritizing code violations in a computer program, using machine learning includes: analyzing the computer program for code violations; extracting code snippets containing violations from the computer program; training a machine learning model to differentiate between vulnerable and non-vulnerable code in the extracted code snippets; inputting the extracted code snippets to a trained machine learning model to assign a vulnerability probability score to each snippet, wherein each vulnerability probability score indicates a severity of the violation for a respective snippet; ranking the code snippets based on their respective vulnerability probability score, wherein a higher score indicates a higher likelihood of causing severe vulnerabilities; and displaying the ranked code snippets to be fixed for their code violations.

## Claims

### Claim 1

A method for prioritizing code violations in a computer program, using machine learning, the method comprising:
analyzing the computer program for code violations;
extracting code snippets containing violations from the computer program;
training a machine learning model to differentiate between vulnerable and non-vulnerable code in the extracted code snippets;
inputting the extracted code snippets to a trained machine learning model to assign a vulnerability probability score to each snippet, wherein each vulnerability probability score indicates a severity of the violation for a respective snippet;
ranking the code snippets based on their respective vulnerability probability score, wherein a higher score indicates a higher likelihood of causing severe vulnerabilities; and
displaying the ranked code snippets to be fixed for their code violations.

### Claim 2 (depends on 1)

The method of claim 1, wherein the vulnerable dataset is created from GitHub commit hashes found in the Common Vulnerabilities and Exposures (CVE).

### Claim 3 (depends on 1)

The method of claim 1, wherein the vulnerable dataset includes unique CVE identifier, a description of the vulnerability, a vulnerability potential impact, and references to related reports.

### Claim 4 (depends on 1)

The method of claim 1, wherein the non-vulnerable dataset is created from open source projects using static analysis tools.

### Claim 5 (depends on 2)

The method of claim 2, wherein creating the vulnerable dataset comprises:
downloading a CVE dataset;
filtering entries in the CVE dataset to identify entries that contain GitHub commit hashes;
downloading corresponding patches for the identified commit hashes;
identifying code in the computer program that was affected by each patch;
reversing each patch in the identified code to restored code in the computer program that was affected by each patch to its pre-patch state;
determining vulnerable files that contain code violation; and
extracting vulnerable code snippets from the vulnerable files.

### Claim 6 (depends on 4)

The method of claim 4, wherein creating the non-vulnerable dataset comprises:
downloading corpora of open-source (OS) projects from an OS project;
analyzing the computer program using code violation testing tools to identify code violations;
removing all functions and methods that are identified with the code violations; and
creating a non-vulnerable) functions and methods dataset including functions or methods that do not contain any code violations from analyzing the computer program.

### Claim 7 (depends on 1)

The method of claim 1, wherein the code violations include security vulnerabilities.

### Claim 8

A system for prioritizing code violations in a computer program, using machine learning comprising:
means for analyzing the computer program for code violations;
means for extracting code snippets containing violations from the computer program;
means for training a machine learning model to differentiate between vulnerable and non-vulnerable code in the extracted code snippets;
means for inputting the extracted code snippets to a trained machine learning model to assign a vulnerability probability score to each snippet, wherein each vulnerability probability score indicates a severity of the violation for a respective snippet;
means for ranking the code snippets based on their respective vulnerability probability score, wherein a higher score indicates a higher likelihood of causing severe vulnerabilities; and
means for displaying the ranked code snippets to be fixed for their code violations.

### Claim 9 (depends on 1)

The system of claim 1, wherein the vulnerable dataset is created from GitHub commit hashes found in the Common Vulnerabilities and Exposures (CVE).

### Claim 10 (depends on 1)

The system of claim 1, wherein the vulnerable dataset includes unique CVE identifier, a description of the vulnerability, a vulnerability potential impact, and references to related reports.

### Claim 11 (depends on 1)

The system of claim 1, wherein the non-vulnerable dataset is created from open-source projects using static analysis tools.

### Claim 12 (depends on 9)

The system of claim 9, wherein means for creating the vulnerable dataset comprises:
means for downloading a CVE dataset;
means for filtering entries in the CVE dataset to identify entries that contain GitHub commit hashes;
means for downloading corresponding patches for the identified commit hashes;
identifying code in the computer program that was affected by each patch;
means for reversing each patch in the identified code to restored code in the computer program that was affected by each patch to its pre-patch state;
means for determining vulnerable files that contain code violation; and
means for extracting vulnerable code snippets from the vulnerable files.

### Claim 13 (depends on 11)

The system of claim 11, wherein means for creating the non-vulnerable dataset comprises:
means for downloading corpora of open-source (OS) projects from an OS project;
analyzing the computer program using code violation testing tools to identify code violations;
means for removing all functions and methods that are identified with the code violations; and
means for creating a non-vulnerable) functions and methods dataset including functions or methods that do not contain any code violations from analyzing the computer program.

### Claim 14 (depends on 9)

The system of claim 9, wherein the code violations include security vulnerabilities.

### Claim 15

A tangible storage medium for storing a plurality of computer codes, the plurality of computer codes when executed by one more computers performing a method for prioritizing code violations in a computer program, using machine learning, the method comprising:
analyzing the computer program for code violations;
extracting code snippets containing violations from the computer program;
training a machine learning model to differentiate between vulnerable and non-vulnerable code in the extracted code snippets;
inputting the extracted code snippets to a trained machine learning model to assign a vulnerability probability score to each snippet, wherein each vulnerability probability score indicates a severity of the violation for a respective snippet;
ranking the code snippets based on their respective vulnerability probability score, wherein a higher score indicates a higher likelihood of causing severe vulnerabilities; and
displaying the ranked code snippets to be fixed for their code violations.

### Claim 16 (depends on 15)

The tangible storage medium of claim 15, wherein the vulnerable dataset is created from GitHub commit hashes found in the Common Vulnerabilities and Exposures (CVE).

### Claim 17 (depends on 15)

The tangible storage medium of claim 15, wherein the non-vulnerable dataset is created from open-source projects using static analysis tools.

### Claim 18 (depends on 16)

The tangible storage medium of claim 16, wherein creating the vulnerable dataset comprises:
downloading a CVE dataset;
filtering entries in the CVE dataset to identify entries that contain GitHub commit hashes;
downloading corresponding patches for the identified commit hashes;
identifying code in the computer program that was affected by each patch;
reversing each patch in the identified code to restored code in the computer program that was affected by each patch to its pre-patch state;
determining vulnerable files that contain code violation; and
extracting vulnerable code snippets from the vulnerable files.

### Claim 19 (depends on 17)

The tangible storage medium of claim 17, wherein creating the non-vulnerable dataset comprises:
downloading corpora of open-source (OS) projects from an OS project;
analyzing the computer program using code violation testing tools to identify code violations;
removing all functions and methods that are identified with the code violations; and
creating a non-vulnerable) functions and methods dataset including functions or methods that do not contain any code violations from analyzing the computer program.

### Claim 20 (depends on 15)

The tangible storage medium of claim 15, wherein the code violations include security vulnerabilities.
