hackedteam/vector-edk

View on GitHub
BaseTools/Source/Python/Workspace/MetaDataTable.py

Summary

Maintainability
F
1 wk
Test Coverage

Function Insert has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def Insert(self, Name, ExtName, Path, FullPath, Model, TimeStamp):
Severity: Minor
Found in BaseTools/Source/Python/Workspace/MetaDataTable.py - About 45 mins to fix

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

    class TableDataModel(Table):
        _COLUMN_ = """
            ID INTEGER PRIMARY KEY,
            CrossIndex INTEGER NOT NULL,
            Name VARCHAR NOT NULL,
    Severity: Major
    Found in BaseTools/Source/Python/Workspace/MetaDataTable.py and 1 other location - About 2 days to fix
    BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py on lines 164..217

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 232.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        def Insert(self, *Args):
            self.ID = self.ID + self._ID_STEP_
            if self.ID >= (self.IdBase + self._ID_MAX_):
                self.ID = self.IdBase + self._ID_STEP_
            Values = ", ".join([str(Arg) for Arg in Args])
    Severity: Major
    Found in BaseTools/Source/Python/Workspace/MetaDataTable.py and 1 other location - About 1 day to fix
    BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py on lines 72..80

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 132.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        def Create(self, NewTable=True):
            if NewTable:
                self.Drop()
    
            if self.Temporary:
    Severity: Major
    Found in BaseTools/Source/Python/Workspace/MetaDataTable.py and 1 other location - About 5 hrs to fix
    BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py on lines 56..66

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 97.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        def GetId(self):
            SqlCommand = """select max(ID) from %s""" % self.Table
            Record = self.Cur.execute(SqlCommand).fetchall()
            Id = Record[0][0]
            if Id == None:
    Severity: Major
    Found in BaseTools/Source/Python/Workspace/MetaDataTable.py and 1 other location - About 3 hrs to fix
    BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py on lines 115..121

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 73.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        def GetFileId(self, File):
            QueryScript = "select ID from %s where FullPath = '%s'" % (self.Table, str(File))
            RecordList = self.Exec(QueryScript)
            if len(RecordList) == 0:
                return None
    Severity: Major
    Found in BaseTools/Source/Python/Workspace/MetaDataTable.py and 1 other location - About 3 hrs to fix
    BaseTools/Source/Python/Table/TableFile.py on lines 99..104

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 70.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        def GetFileTimeStamp(self, FileId):
            QueryScript = "select TimeStamp from %s where ID = '%s'" % (self.Table, FileId)
            RecordList = self.Exec(QueryScript)
            if len(RecordList) == 0:
                return None
    Severity: Major
    Found in BaseTools/Source/Python/Workspace/MetaDataTable.py and 1 other location - About 3 hrs to fix
    BaseTools/Source/Python/Workspace/MetaDataTable.py on lines 237..242

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 66.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        def GetFileType(self, FileId):
            QueryScript = "select Model from %s where ID = '%s'" % (self.Table, FileId)
            RecordList = self.Exec(QueryScript)
            if len(RecordList) == 0:
                return None
    Severity: Major
    Found in BaseTools/Source/Python/Workspace/MetaDataTable.py and 1 other location - About 3 hrs to fix
    BaseTools/Source/Python/Workspace/MetaDataTable.py on lines 250..255

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 66.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        def Query(self):
            SqlCommand = """select * from %s""" % self.Table
            self.Cur.execute(SqlCommand)
            for Rs in self.Cur:
                EdkLogger.verbose(str(Rs))
    Severity: Major
    Found in BaseTools/Source/Python/Workspace/MetaDataTable.py and 1 other location - About 2 hrs to fix
    BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py on lines 86..91

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 60.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        def __init__(self, Cursor, Name='', IdBase=0, Temporary=False):
            self.Cur = Cursor
            self.Table = Name
            self.IdBase = int(IdBase)
            self.ID = int(IdBase)
    Severity: Major
    Found in BaseTools/Source/Python/Workspace/MetaDataTable.py and 1 other location - About 2 hrs to fix
    BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py on lines 42..47

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 57.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        def IsIntegral(self):
            Result = self.Exec("select min(ID) from %s" % (self.Table))
            if Result[0][0] != -1:
                return False
            return True
    Severity: Major
    Found in BaseTools/Source/Python/Workspace/MetaDataTable.py and 1 other location - About 2 hrs to fix
    BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py on lines 147..151

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 53.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        def GetCount(self):
            SqlCommand = """select count(ID) from %s""" % self.Table
            Record = self.Cur.execute(SqlCommand).fetchall()
            return Record[0][0]
    Severity: Major
    Found in BaseTools/Source/Python/Workspace/MetaDataTable.py and 1 other location - About 2 hrs to fix
    BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py on lines 110..113

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 51.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        def Exec(self, SqlCommand):
            EdkLogger.debug(EdkLogger.DEBUG_5, SqlCommand)
            self.Cur.execute(SqlCommand)
            RecordSet = self.Cur.fetchall()
            return RecordSet
    Severity: Major
    Found in BaseTools/Source/Python/Workspace/MetaDataTable.py and 1 other location - About 1 hr to fix
    BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py on lines 138..142

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 44.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

    def ConvertToSqlString(StringList):
        return map(lambda s: "'" + s.replace("'", "''") + "'", StringList)
    Severity: Major
    Found in BaseTools/Source/Python/Workspace/MetaDataTable.py and 1 other location - About 1 hr to fix
    BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py on lines 24..25

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 39.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status