Code Duplication    Length = 12-13 lines in 2 locations

bika/lims/content/abstractbaseanalysis.py 2 locations

@@ 851-863 (lines=13) @@
848
        items.sort(lambda x, y: cmp(x[1], y[1]))
849
        return DisplayList(list(items))
850
851
    @security.public
852
    def getDepartments(self):
853
        """A vocabulary listing available (and activated) departments.
854
        """
855
        bsc = getToolByName(self, 'bika_setup_catalog')
856
        items = [('', '')] + [(o.UID, o.Title) for o in
857
                              bsc(portal_type='Department',
858
                                  is_active=True)]
859
        o = self.getDepartment()
860
        if o and o.UID() not in [i[0] for i in items]:
861
            items.append((o.UID(), o.Title()))
862
        items.sort(lambda x, y: cmp(x[1], y[1]))
863
        return DisplayList(list(items))
864
865
    @security.public
866
    def getLowerDetectionLimit(self):
@@ 838-849 (lines=12) @@
835
        vat = vat and vat or 0
836
        return float(price) + (float(price) * float(vat)) / 100
837
838
    @security.public
839
    def getAnalysisCategories(self):
840
        """A vocabulary listing available (and activated) categories.
841
        """
842
        bsc = getToolByName(self, 'bika_setup_catalog')
843
        cats = bsc(portal_type='AnalysisCategory', is_active=True)
844
        items = [(o.UID, o.Title) for o in cats]
845
        o = self.getCategory()
846
        if o and o.UID() not in [i[0] for i in items]:
847
            items.append((o.UID(), o.Title()))
848
        items.sort(lambda x, y: cmp(x[1], y[1]))
849
        return DisplayList(list(items))
850
851
    @security.public
852
    def getDepartments(self):