• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SE25GroupProject / my-cookbook / 13548499350

26 Feb 2025 04:19PM UTC coverage: 80.058% (+13.0%) from 67.099%
13548499350

push

github

web-flow
Merge pull request #48 from SE25GroupProject/Pylint

Starting Lint

1381 of 1725 relevant lines covered (80.06%)

0.8 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

34.88
api/db/objects.py
1
"""Holds classes of all objects for database use"""
2

3

4
class User():
1✔
5
    def __init__(self, username: str, password: str, userId: int = -1):
1✔
6
        self.UserId = userId
1✔
7
        self.Username = username
1✔
8
        self.Password = password
1✔
9

10
    def to_dict(self) -> dict:
1✔
11
        output = {
1✔
12
            "userId": self.UserId,
13
            "username": self.Username,
14
        }
15

16
        return output
1✔
17

18

19
class Ingredient():
1✔
20
    def __init__(self, name: str, amount: float):
1✔
21
        self.Name = name
×
22
        self.Amount = amount
×
23

24

25
class Instruction():
1✔
26
    def __init__(self, step: int, instruction: str):
1✔
27
        self.Step = step
×
28
        self.Instruction = instruction
×
29

30

31
class Recipe():
1✔
32

33
    def __init__(self, name: str, cookTime: str, prepTime: str,
1✔
34
                 totalTime: str, description: str, category: str,
35
                 rating: float, calories: float, fat: float,
36
                 saturatedFat: float, cholesterol: float,
37
                 sodium: float, carbs: float, fiber: float,
38
                 sugar: float, protein: float, servings: float,
39
                 images: list[str], tags: list[str],
40
                 ingredients: list[Ingredient], instructions:
41
                 list[Instruction], recipeId=-1):
42
        self.RecipeId = recipeId
×
43
        self.Name = name
×
44
        self.CookTime = cookTime
×
45
        self.PrepTime = prepTime
×
46
        self.TotalTime = totalTime
×
47
        self.Description = description
×
48
        self.Category = category
×
49
        self.Rating = rating
×
50
        self.Calories = calories
×
51
        self.Fat = fat
×
52
        self.SaturatedFat = saturatedFat
×
53
        self.Cholesterol = cholesterol
×
54
        self.Sodium = sodium
×
55
        self.Carbs = carbs
×
56
        self.Fiber = fiber
×
57
        self.Sugar = sugar
×
58
        self.Protein = protein
×
59
        self.Servings = servings
×
60
        self.Images = images
×
61
        self.Tags = tags
×
62
        self.Ingredients = ingredients
×
63
        self.Instructions = instructions
×
64

65
    def to_dict(self) -> dict:
1✔
66
        output = {
×
67
            "name": self.Name,
68
            "cookTime": self.CookTime,
69
            "prepTime": self.PrepTime,
70
            "totalTime": self.TotalTime,
71
            "description": self.Description,
72
            "category": self.Category,
73
            "rating": self.Rating,
74
            "calories": self.Calories,
75
            "fat": self.Fat,
76
            "saturatedFat": self.SaturatedFat,
77
            "cholesterol": self.Cholesterol,
78
            "sodium": self.Sodium,
79
            "carbs": self.Carbs,
80
            "fiber": self.Fiber,
81
            "sugar": self.Sugar,
82
            "protein": self.Protein,
83
            "servings": self.Servings,
84
            "images": self.Images,
85
            "tags": self.Tags,
86
            "ingredients": self.Ingredients,
87
            "instructions": self.Instructions
88
        }
89

90
        return output
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc