US 11,868,766 B2
Method and system for identifying duplicate cascading style sheets (CSS) selector declarations
Mitchell Adair, Holly Springs, NC (US); Edward Dunlop, Cary, NC (US); and Asiyah Ahmad, Cary, NC (US)
Assigned to HCL America Inc., Sunnyvale, CA (US)
Filed by HCL America Inc., Sunnyvale, CA (US)
Filed on Mar. 15, 2022, as Appl. No. 17/694,711.
Prior Publication US 2023/0297367 A1, Sep. 21, 2023
Int. Cl. G06F 8/71 (2018.01)
CPC G06F 8/71 (2013.01) 20 Claims
OG exemplary drawing
 
1. A method for identifying duplicate Cascading Style Sheets (CSS) selector declarations in CSS code bases, the method comprising:
receiving, by a selector detecting device, at least one updated CSS code file in a CSS code base from a user, wherein the CSS code base comprises a plurality of CSS code files, wherein the at least one updated CSS code file is one of the plurality of CSS code files, and wherein each of the plurality of CSS code files comprises a plurality of selector declarations; and
for each of the plurality of selector declarations,
identifying, by the selector detecting device, one or more locations associated with a selector declaration in each of the plurality of CSS code files of the CSS code base in real time, wherein each of the one or more locations comprises a file path corresponding to a CSS code file with the selector declaration and a line number corresponding to the selector declaration in the CSS code file;
generating, by the selector detecting device, a set of selector locations in each of the plurality of CSS code files, wherein the set of selector locations is an array comprising the one or more locations associated with the selector declaration; and
determining, by the selector detecting device, a number of elements in the set of selector locations corresponding to the selector declaration.