# US 12,001,322 B2 · Code linting in dynamic application environments

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

- Number: US 12,001,322 B2
- Document ID: US12001322B2
- Status: Granted
- Kind: B2
- Application number: 17/668,220
- Filed: 2022-02-09
- Published: 2023-08-10
- Granted: 2024-06-04
- Earliest claimed: 2022-02-09
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Michael Shinichiro Vaquier; Gergely Z. Kota
- Web page: https://patentgrep.com/patent/US12001322B2

## CPC

- G06F 11/323: {Visualisation of programs or trace data}
- G06F 11/3676: {for coverage analysis}
- G06F 8/75: Structural analysis for program understanding
- G06F 11/3604: Analysis of software for verifying properties of programs (testing of software G06F11/3668)
- G06F 11/3612: {by runtime analysis (performance monitoring G06F11/3466)}
- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F 11/3692: {for test results analysis}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems, methods, and software are disclosed herein that support enhanced code linting. In an implementation, an application hosts a content object that is the subject of one or more scripts for automating tasks. A linter obtains an initial state of the content object from the application and generates a model that reflects the object's state. The linter also performs an analysis of the code statements with respect to the model. The linter may then enable or otherwise cause one or more results of the analysis to be displayed in a user interface to a code editor used for interacting with the scripts.

## Claims

### Claim 1

A computing apparatus comprising:
one or more computer readable storage media;
one or more processors operatively coupled with the one or more computer readable storage media; and
program instructions stored on the one or more computer readable storage media that, when executed by the one or more processors, direct the computing apparatus to at least:
display, in a code editor interface, code statements of a script relating to a content object hosted by an application, wherein the content object comprises a spreadsheet workbook;
obtain an initial state of the content object from the application, wherein the initial state identifies elements of the spreadsheet workbook;
generate a model that reflects at least the initial state of the content object;
perform an analysis of the code statements with respect to the model to identify a change to an element of the spreadsheet workbook implied by a code statement of the code statements;
update the model to reflect the change to the element implied by the code statement;
determine, based on the updated model, that the change to the element implied by the code statement will cause an error at a time of execution of the code statement; and
display an indication of the error in the code editor interface.

### Claim 2 (depends on 1)

The computing apparatus of claim 1 wherein, to perform the analysis of the code statements, the program instructions further direct the computing apparatus to at least:
identify references in the code statements to elements of the content object;
check the model to determine whether the elements exist in the content object; and
for at least a one of the elements determined not to exist in the content object, surface an indication of an invalid element in the code editor interface.

### Claim 3 (depends on 2)

The computing apparatus of claim 2 wherein the change to the element of the spreadsheet workbook implied by the code statement comprises a deletion of the element from the content object.

### Claim 4 (depends on 3)

The computing apparatus of claim 3 wherein to determine that the change to the element of the spreadsheet workbook implied by the code statement will cause an error at the time of execution of the code statement, the program instructions direct the computing apparatus to determine whether the implied change is rectified by a change implied by a second code statement.

### Claim 5 (depends on 4)

The computing apparatus of claim 4 wherein the elements of the content object comprise worksheets of the spreadsheet workbook, and tables in the worksheets.

### Claim 6 (depends on 5)

The computing apparatus of claim 5 wherein the program instructions comprise one or more components of the code editor.

### Claim 7 (depends on 6)

The computing apparatus of claim 6 wherein the code editor comprises a component of the application, wherein the application comprises a spreadsheet application.

### Claim 8 (depends on 2)

The computing apparatus of claim 2 wherein the program instructions further direct the computing apparatus to at least:
obtain, from the application, information indicative of a new state of the content object resulting from actual changes made to the content object by the application; and
refresh the model to reflect the new state of the content object.

### Claim 9 (depends on 2)

The computing apparatus of claim 2 wherein the change to the element of the spreadsheet workbook implied by the code statement comprises an addition of a new element to the content object.

### Claim 10 (depends on 1)

The computing apparatus of claim 1 wherein the change to the element implied by the code statement comprises a state change with respect to the content object which occurs at the time of execution of the code statement.

### Claim 11

One or more computer readable storage media having program instructions stored thereon that, when executed by one or more processors, direct a computing apparatus to at least:
identify code statements in one or more scripts associated with a content object opened in an application, wherein the content object comprises a spreadsheet workbook;
obtain an initial state of the content object from the application, wherein the initial state identifies elements of the spreadsheet workbook;
generate a model that reflects at least the initial state of the content object;
perform an analysis of the code statements with respect to the model to identify a change to an element of the spreadsheet workbook implied by a code statement of the code statements;
update the model to reflect the change to the element implied by the code statement;
determine, based on the updated model, that the change to the element implied by the code statement will cause an error at a time of execution of the code statement; and
display an indication of the error in a user interface to the application.

### Claim 12 (depends on 11)

The one or more computer readable storage media of claim 11 wherein, to perform the analysis of the code statements, the program instructions further direct the computing apparatus to at least:
identify references in the code statements to elements of the content object;
check the model to determine whether the elements exist in the content object; and
for at least a one of the elements determined not to exist in the content object, surface an indication of an invalid element in the user interface to the application.

### Claim 13 (depends on 12)

The one or more computer readable storage media of claim 12 wherein the program instructions further direct the computing apparatus to at least:
obtain, from the application, information indicative of a new state of the content object resulting from actual changes made to the content object by the application; and
refresh the model to reflect the new state of the content object.

### Claim 14 (depends on 13)

The one or more computer readable storage media of claim 13 wherein the change to the content object implied by the code statements comprises an addition of a new element to the content object.

### Claim 15 (depends on 11)

The one or more computer readable storage media of claim 11 wherein the change to the element implied by the code statement comprises a deletion of the element from the content object.

### Claim 16 (depends on 11)

The one or more computer readable storage media of claim 11 wherein to determine that the change to the element of the spreadsheet workbook implied by the code statement will cause an error at the time of execution of the code statement, the program instructions direct the computing apparatus to determine whether the change is rectified by a change implied by a second code statement.

### Claim 17

A method of operating a computing device to analyze computer program code, the method comprising:
the computing device enabling display of, in a user interface to code editor, code statements of a script relating to a content object hosted by an application, wherein the content object comprises a spreadsheet workbook;
the computing device obtaining an initial state of the content object from the application, wherein the initial state identifies elements of the spreadsheet workbook;
the computing device generating a model that reflects at least the initial state of the content object;
the computing device analyzing the code statements with respect to the model to identify a change to an element of the spreadsheet workbook implied by a code statement of the code statements;
the computing device updating the model to reflect the change to the element implied by the code statement;
the computing device determining, based on the updated model, that the change to the element implied by the code statement will cause an error at a time of execution of the code statement; and
the computing device enabling display of an indication of the error in the user interface to the code editor.

### Claim 18 (depends on 17)

The method of claim 17 wherein, analyzing the code statements further comprises:
identifying references in the code statements to elements of the content object;
checking the model to determine whether the elements exist in the content object; and
for at least a one of the elements determined not to exist in the content object, enabling display of an indication of an invalid element in the user interface to the code editor.

### Claim 19 (depends on 18)

The method of claim 18 wherein the change to the element implied by the code statement comprises a deletion of the element from the content object.

### Claim 20 (depends on 18)

The method of claim 18 wherein the method further comprises:
obtaining, from the application, information indicative of a new state of the content object resulting from actual changes made to the content object by the application; and
refreshing the model to reflect the new state of the content object.
