IP Library Granted Patent US 10,102,105
Granted Patent B2
US 10,102,105 · App. 15/302,759 · Granted Oct 16, 2018

Determining code complexity scores

Inventors: Inbar Shani (Yehud, IL); Ohad Assulin (Yehud, IL); Yaron Burg (Yehud, IL)
Assignee: ENTIT SOFTWARE LLC
G06F11/3608G06F8/77G06F11/34G06F11/3604G06F11/3616
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,102,105
App. No.
15/302,759
Filed
Oct 7, 2016
Granted
Oct 16, 2018
Kind
B2
Examiner
WEI, ZHENG
Art Unit
2192
USPC
717/126
Abstract

In one example of the disclosure, code lines for a software program are received, the code lines including a unit of code lines. Code entities within the unit are identified. Each code entity includes a line or consecutive lines of code implementing a distinct program requirement or defect fix for the program. Context changes are identified within the unit, each context change including an occurrence of a first code line set implementing an entity, adjacent to a second code line set implementing another entity, within a same code scope. A code complexity score is determined based upon counts of entities identified and context changes identified within the unit, and upon counts of code lines and entities within the program.

Claims (44)

1. A system, comprising:

a processor; and

a memory storing instructions that when executed by the processor cause the processor to:

receive a unit of code lines of a software program;

identify a plurality of entities within the unit of code lines, wherein each entity includes a set of code lines implementing a distinct program requirement or defect fix for the software program;

identify context changes within the unit of code lines, wherein each context change is an occurrence of a first entity that includes a first code line set implementing a first program requirement or defect fix, adjacent to a second entity that includes a second code line set implementing a second program requirement or defect fix, within a same code scope of the software program;

determine a code complexity score of the unit of code lines based upon a total number of entities identified and a total number of context changes identified within the unit of code lines, and upon total numbers of code lines and entities within the software program; and

generate a recommendation to rework the unit of code lines of the software program based on a comparison of the determined code complexity score and a previously determined code complexity score.

2. The system of claim 1 , wherein the code lines of the unit are consecutive code lines.

3. The system of claim 1 , wherein, to identify each entity within the unit of code lines, the instructions are to cause the processor to access metadata tags within the unit of code lines to determine a set of code lines that implements a distinct program requirement or defect fix.

4. The system of claim 1 , wherein, to identify each entity within the unit of code lines, the instructions are to cause the processor to access comments within the unit of code lines to determine a set of code lines that implements a distinct program requirement or defect fix.

5. The system of claim 1 , wherein the instructions are to cause the processor to determine the code complexity score based upon the formula

code complexity=( E n *S n )/(LOC* E t )

wherein E n is the total number of the entities identified in the unit of code lines, S n is the total number of the context changes within the unit of code lines, LOC is the total number of lines of code within the software program, and E t is the total number of entities within the software program.

6. The system of claim 1 , wherein the same code scope is a same scope of method in the software program.

7. The system of claim 1 , wherein the same code scope is one of a same class, a same file, a same loop, and a same closure.

8. The system of claim 1 , wherein the code complexity score is a first code complexity score, and wherein the instructions are to cause the processor to access a database to obtain the previously determined code complexity score, and determine the recommendation to rework the software program based upon a comparison of the first code complexity score to the previously determined score.

9. The system of claim 1 , wherein the instructions are to cause the processor to send the determined code complexity score to a developer software application or developer computing device.

10. A non-transitory computer readable storage medium storing instructions that when executed cause a processing resource to:

receive a unit of code lines of a software program;

identify a plurality of entities within the unit of code lines, wherein each entity includes a set of code lines implementing a distinct program requirement or defect fix for the program, and apply a relevancy filter to identify from the entities a set of relevant entities;

identify context changes within the unit of code lines, wherein each context change is an occurrence of a first one of the relevant entities that includes a first code line set implementing a first program requirement or defect fix, adjacent to a second one of the relevant entities that includes a second code line set implementing a second program requirement or defect fix, within a same code scope of the software program;

determine a code complexity score of the unit of code lines based upon a total number of relevant entities identified and a total number of context changes between relevant entities identified within the unit of code lines, and upon total numbers of code lines and entities within the software program; and

generate a recommendation to rework the unit of code lines of the software program based on a comparison of the determined code complexity score and a previously determined code complexity score.

11. The non-transitory computer readable storage medium of claim 10 , wherein the instructions are to cause processing resource to identify the set of relevant entities according to one of a program release date, a program version, a development period, and a development team.

12. The non-transitory computer readable storage medium of claim 10 , wherein the instructions are to cause processing resource to identify the set of relevant entities according to functionality of the entities.

13. The non-transitory computer readable storage medium of claim 10 , wherein the instructions are to cause processing resource to identify the set of relevant entities according to functionality versus nonfunctionality of the entities.

14. The non-transitory computer readable storage medium of claim 10 , wherein the instructions are to cause the processor to determine the code complexity score based upon the formula

code complexity=( E n *S n )/(LOC* E t )

wherein E n is the total number of the entities identified in the unit of code lines, S n is the total number of the context changes within the unit of code lines, LOC is the total number of code lines within the software program, and E t is the total number of the entities within the software program.

15. The non-transitory computer readable storage medium of claim 10 , wherein the determined code complexity score is a first code complexity score, and wherein the instructions are to cause the processing resource to access a database to obtain the previously determined code complexity score, and determine the recommendation to rework the unit of code lines of the software program based upon a comparison of the first code complexity score to the previously determined code complexity score.

16. A method to determine code complexity scores, comprising:

identifying, by a processor of a computing device, a unit of code lines within a software program;

identifying, by the processor, a plurality of entities within the unit of code lines, wherein each entity includes a set of code lines implementing a distinct program requirement or defect fix for the software program;

identifying, by the processor, context changes within the unit of code lines, wherein each context change is an occurrence of a first entity that includes a first code line set implementing a first program requirement or defect fix, adjacent to a second entity that includes a second code line set implementing a second program requirement or defect fix, within a same code scope of the software program;

determining, by the processor, a code complexity score of the unit of code lines based upon a total number of the entities identified and a total number of the context changes identified within the unit of code lines, and upon total numbers of code lines and entities within the software program; and

generating, by the processor, a recommendation to rework the unit of code lines of the software program based on a comparison of the determined code complexity score and a previously determined code complexity score.

17. The method of claim 16 , wherein the same code scope in the software program is one of a same method, a same class, and a same closure.

18. The method of claim 16 , wherein determining the code complexity score is based upon the formula

code complexity=( E n *S n )/(LOC* E t )

wherein E n is the total number of the entities identified in the unit of code lines, S n is the total number of the context changes within the unit of code lines, LOC is the total number of code lines within the software program, and E t is the total number of the entities within the software program.

19. The method of claim 16 , wherein the determined code complexity score is a first code complexity score, and the method further comprising:

accessing a database to obtain the previously determined code complexity score, and

determining the recommendation to rework the unit of code lines of the software program based upon a comparison of the first code complexity score to the previously determined code complexity score.

Assignments (8)
RELEASE OF SECURITY INTEREST REEL/FRAME 044183/0577 Recorded Feb 2, 2023
From: JPMORGAN CHASE BANK, N.A.
To: MICRO FOCUS LLC (F/K/A ENTIT SOFTWARE LLC)
Reel/Frame 063560/0001 →
RELEASE OF SECURITY INTEREST REEL/FRAME 044183/0718 Recorded Feb 2, 2023
From: JPMORGAN CHASE BANK, N.A.
To: MICRO FOCUS LLC (F/K/A ENTIT SOFTWARE LLC); BORLAND SOFTWARE CORPORATION; MICRO FOCUS (US), INC.; SERENA SOFTWARE, INC; ATTACHMATE CORPORATION; MICRO FOCUS SOFTWARE INC. (F/K/A NOVELL, INC.); NETIQ CORPORATION
Reel/Frame 062746/0399 →
CHANGE OF NAME Recorded Aug 8, 2019
From: ENTIT SOFTWARE LLC
To: MICRO FOCUS LLC
Reel/Frame 050004/0001 →
SECURITY INTEREST Recorded Oct 11, 2017
From: ATTACHMATE CORPORATION; BORLAND SOFTWARE CORPORATION; NETIQ CORPORATION; MICRO FOCUS (US), INC.; MICRO FOCUS SOFTWARE, INC.; ENTIT SOFTWARE LLC; ARCSIGHT, LLC; SERENA SOFTWARE, INC.
To: JPMORGAN CHASE BANK, N.A.
Reel/Frame 044183/0718 →
SECURITY INTEREST Recorded Oct 11, 2017
From: ENTIT SOFTWARE LLC; ARCSIGHT, LLC
To: JPMORGAN CHASE BANK, N.A.
Reel/Frame 044183/0577 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 9, 2017
From: HEWLETT PACKARD ENTERPRISE DEVELOPMENT LP
To: ENTIT SOFTWARE LLC
Reel/Frame 042746/0130 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 17, 2016
From: SHANI, INBAR; ASSULIN, OHAD; BURG, YARON
To: HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
Reel/Frame 040645/0211 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 17, 2016
From: HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
To: HEWLETT PACKARD ENTERPRISE DEVELOPMENT LP
Reel/Frame 040649/0001 →
Continuity (1)
Related Publication 20170031800A1 · Feb 2, 2017