diff options
author | Pierre Gondois <pierre.gondois@arm.com> | 2025-04-30 14:59:09 +0200 |
---|---|---|
committer | Liming Gao <gaoliming@byosoft.com.cn> | 2025-07-01 09:51:38 +0800 |
commit | ee791006781e821e1d415f15433bfa95b9e83500 (patch) | |
tree | b4a6884e3cd680bbcb3a1e7d836dcd74ee3ba3ea /BaseTools/Source/Python | |
parent | fa2c27514c5923d8a1c7f8cb7b1bf2f3b69c4331 (diff) | |
download | edk2-ee791006781e821e1d415f15433bfa95b9e83500.zip edk2-ee791006781e821e1d415f15433bfa95b9e83500.tar.gz edk2-ee791006781e821e1d415f15433bfa95b9e83500.tar.bz2 |
BaseTools: Table: Remove unnecessary code
Running the vulture tool on the Table folder gave the following
report. Remove the unnecessary code.
- Table/Table.py:88:
unused method 'GenerateID' (60% confidence)
- Table/TableDataModel.py:83:
unused method 'GetCrossIndex' (60% confidence)
- Table/TableEotReport.py:66:
unused method 'GetMaxID' (60% confidence)
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Diffstat (limited to 'BaseTools/Source/Python')
-rw-r--r-- | BaseTools/Source/Python/Table/Table.py | 14 | ||||
-rw-r--r-- | BaseTools/Source/Python/Table/TableDataModel.py | 16 | ||||
-rw-r--r-- | BaseTools/Source/Python/Table/TableEotReport.py | 6 |
3 files changed, 0 insertions, 36 deletions
diff --git a/BaseTools/Source/Python/Table/Table.py b/BaseTools/Source/Python/Table/Table.py index 7a60313..47ebea6 100644 --- a/BaseTools/Source/Python/Table/Table.py +++ b/BaseTools/Source/Python/Table/Table.py @@ -77,20 +77,6 @@ class Table(object): for Item in self.Cur:
return Item[0]
- ## Generate ID
- #
- # Generate an ID if input ID is -1
- #
- # @param ID: Input ID
- #
- # @retval ID: New generated ID
- #
- def GenerateID(self, ID):
- if ID == -1:
- self.ID = self.ID + 1
-
- return self.ID
-
## Init the ID of the table
#
# Init the ID of the table
diff --git a/BaseTools/Source/Python/Table/TableDataModel.py b/BaseTools/Source/Python/Table/TableDataModel.py index 3855807..7d1d7ed 100644 --- a/BaseTools/Source/Python/Table/TableDataModel.py +++ b/BaseTools/Source/Python/Table/TableDataModel.py @@ -72,19 +72,3 @@ class TableDataModel(Table): Description = Item[0]
self.Insert(CrossIndex, Name, Description)
EdkLogger.verbose("Initialize table DataModel ... DONE!")
-
- ## Get CrossIndex
- #
- # Get a model's cross index from its name
- #
- # @param ModelName: Name of the model
- # @retval CrossIndex: CrossIndex of the model
- #
- def GetCrossIndex(self, ModelName):
- CrossIndex = -1
- SqlCommand = """select CrossIndex from DataModel where name = '""" + ModelName + """'"""
- self.Cur.execute(SqlCommand)
- for Item in self.Cur:
- CrossIndex = Item[0]
-
- return CrossIndex
diff --git a/BaseTools/Source/Python/Table/TableEotReport.py b/BaseTools/Source/Python/Table/TableEotReport.py index abd433e..db6660f 100644 --- a/BaseTools/Source/Python/Table/TableEotReport.py +++ b/BaseTools/Source/Python/Table/TableEotReport.py @@ -62,9 +62,3 @@ class TableEotReport(Table): % (self.Table, self.ID, ModuleID, ModuleName, ModuleGuid, SourceFileID, SourceFileFullPath, \
ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, BelongsToFunction, Enabled)
Table.Insert(self, SqlCommand)
-
- def GetMaxID(self):
- SqlCommand = """select max(ID) from %s""" % self.Table
- self.Cur.execute(SqlCommand)
- for Item in self.Cur:
- return Item[0]
|