GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (284)

taskjuggler_python/jsonjuggler.py (55 issues)

1
# json parser implementation
2
from juggler import *
0 ignored issues
show
The usage of wildcard imports like juggler should generally be avoided.
Loading history...
JugglerSimpleProperty was imported with wildcard, but is not used.
Loading history...
JugglerTimesheet was imported with wildcard, but is not used.
Loading history...
JugglerTaskProperty was imported with wildcard, but is not used.
Loading history...
is_number was imported with wildcard, but is not used.
Loading history...
DEFAULT_OUTPUT was imported with wildcard, but is not used.
Loading history...
os was imported with wildcard, but is not used.
Loading history...
set_logging_level was imported with wildcard, but is not used.
Loading history...
to_tj3interval was imported with wildcard, but is not used.
Loading history...
JugglerCompoundKeyword was imported with wildcard, but is not used.
Loading history...
JugglerOutputdir was imported with wildcard, but is not used.
Loading history...
icalendar was imported with wildcard, but is not used.
Loading history...
TAB was imported with wildcard, but is not used.
Loading history...
JugglerTimezone was imported with wildcard, but is not used.
Loading history...
to_tj3time was imported with wildcard, but is not used.
Loading history...
shutil was imported with wildcard, but is not used.
Loading history...
logging was imported with wildcard, but is not used.
Loading history...
subprocess was imported with wildcard, but is not used.
Loading history...
tempfile was imported with wildcard, but is not used.
Loading history...
datetime was imported with wildcard, but is not used.
Loading history...
DEFAULT_LOGLEVEL was imported with wildcard, but is not used.
Loading history...
to_identifier was imported with wildcard, but is not used.
Loading history...
from_identifier was imported with wildcard, but is not used.
Loading history...
TJP_DASH_PREFIX was imported with wildcard, but is not used.
Loading history...
TJP_NUM_ID_PREFIX was imported with wildcard, but is not used.
Loading history...
TJP_SPACE_PREFIX was imported with wildcard, but is not used.
Loading history...
OrderedDict was imported with wildcard, but is not used.
Loading history...
DEBUG was imported with wildcard, but is not used.
Loading history...
JugglerWorkingHours was imported with wildcard, but is not used.
Loading history...
3
import json, re, math
0 ignored issues
show
Multiple imports on one line (json, re, math)
Loading history...
standard import "import json, re, math" should be placed before "from juggler import *"
Loading history...
4
import dateutil.parser
0 ignored issues
show
third party import "import dateutil.parser" should be placed before "from juggler import *"
Loading history...
5
6
class DictJugglerTaskDepends(JugglerTaskDepends):
7
    def load_from_issue(self, issue):
8
        """
9
        Args:
10
            issue["depends"] - a list of identifiers that this task depends on
11
        """
12
        if "depends" in issue: 
0 ignored issues
show
Trailing whitespace
Loading history...
13
            # TODO HERE: remove ID normalization!
14
            if isinstance(issue["depends"], str) or isinstance(issue['depends'], unicode):
0 ignored issues
show
Consider merging these isinstance calls to isinstance(issue['depends'], (str, unicode))
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'unicode'
Loading history...
15
                self.set_value([int(x) for x in re.findall(r"[\w']+", issue["depends"])])
16
            # TODO check for list, else add idfr
17
            else: self.set_value([int(x) for x in issue["depends"]])
18
19
class DictJugglerTaskPriority(JugglerTaskPriority):
20
    def load_from_issue(self, issue):
21
        if "priority" in issue: self.set_value(int(issue["priority"]))
0 ignored issues
show
More than one statement on a single line
Loading history...
22
        
0 ignored issues
show
Trailing whitespace
Loading history...
23
class DictJugglerTaskStart(JugglerTaskStart):
24
    def load_from_issue(self, issue):
25
        if "start" in issue: 
0 ignored issues
show
Trailing whitespace
Loading history...
26
            if isinstance(issue["start"], str) or isinstance(issue['start'], unicode):
0 ignored issues
show
Consider merging these isinstance calls to isinstance(issue['start'], (str, unicode))
Loading history...
Comprehensibility Best Practice introduced by
Undefined variable 'unicode'
Loading history...
27
                self.set_value(dateutil.parser.parse(issue["start"]))
28
            else:
29
                self.set_value(issue["start"])
30
        
0 ignored issues
show
Trailing whitespace
Loading history...
31
class DictJugglerTaskEffort(JugglerTaskEffort):
32
    UNIT = "h"
33
    def load_from_issue(self, issue):
34
        if "effort" in issue: self.set_value(math.ceil(issue["effort"]))
0 ignored issues
show
More than one statement on a single line
Loading history...
35
36
class DictJugglerTaskAllocate(JugglerTaskAllocate):
37
    def load_from_issue(self, issue):
0 ignored issues
show
Bug Best Practice introduced by
Signature differs from overridden 'load_from_issue' method

It is generally a good practice to use signatures that are compatible with the Liskov substitution principle.

This allows to pass instances of the child class anywhere where the instances of the super-class/interface would be acceptable.

Loading history...
38
        if "allocate" in issue: alloc = issue["allocate"]
0 ignored issues
show
More than one statement on a single line
Loading history...
39
        else: alloc = "me" # stub!
40
        self.set_value(alloc) 
0 ignored issues
show
Trailing whitespace
Loading history...
41
        src.walk(JugglerSource)[0].set_property(DictJugglerResource(issue))
42
43
class DictJugglerTask(JugglerTask):
44
    def load_default_properties(self, issue):
0 ignored issues
show
Bug Best Practice introduced by
Signature differs from overridden 'load_default_properties' method

It is generally a good practice to use signatures that are compatible with the Liskov substitution principle.

This allows to pass instances of the child class anywhere where the instances of the super-class/interface would be acceptable.

Loading history...
45
        self.set_property(DictJugglerTaskDepends(issue))
46
        self.set_property(DictJugglerTaskEffort(issue))
47
        self.set_property(DictJugglerTaskAllocate(issue))
48
        self.set_property(DictJugglerTaskStart(issue))
49
        self.set_property(DictJugglerTaskPriority(issue))
50
    def load_from_issue(self, issue):
51
        self.set_id(issue["id"])
52
        if "summary" in issue: self.summary = issue["summary"]
0 ignored issues
show
More than one statement on a single line
Loading history...
53
54
class DictJuggler(GenericJuggler):
0 ignored issues
show
The method __inter__ which was declared abstract in the super-class GenericJuggler
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
55
    """ a simple dictionary based format parser """
56
    def __init__(self, issues):
0 ignored issues
show
The __init__ method of the super-class GenericJuggler is not called.

It is generally advisable to initialize the super-class by calling its __init__ method:

class SomeParent:
    def __init__(self):
        self.x = 1

class SomeChild(SomeParent):
    def __init__(self):
        # Initialize the super class
        SomeParent.__init__(self)
Loading history...
57
        self.issues = issues
58
    def load_issues(self):
59
        return self.issues
60
    def create_task_instance(self, issue):
61
        return DictJugglerTask(issue)
62
    def create_jugglersource_instance(self):
63
        global src
0 ignored issues
show
Global variable 'src' undefined at the module level
Loading history...
64
        src = DictJugglerSource()
65
        return src
66
67
class DictJugglerSource(JugglerSource):
68
    def load_default_properties(self, issue = None):
0 ignored issues
show
No space allowed around keyword argument assignment
Loading history...
69
        self.set_property(JugglerProject())
70
        # self.set_property(DictJugglerResource()) # define no resource
71
        self.set_property(JugglerIcalreport())
72
        
0 ignored issues
show
Trailing whitespace
Loading history...
73
class DictJugglerResource(JugglerResource):
74
    def load_from_issue(self, issue):
75
        if "allocate" in issue:
76
            self.set_id(issue["allocate"])
77
            self.set_value(issue["allocate"])
78
79
class JsonJuggler(DictJuggler):
0 ignored issues
show
The method __inter__ which was declared abstract in the super-class GenericJuggler
was not overridden.

Methods which raise NotImplementedError should be overridden in concrete child classes.

Loading history...
80
    def __init__(self, json_issues):
0 ignored issues
show
The __init__ method of the super-class DictJuggler is not called.

It is generally advisable to initialize the super-class by calling its __init__ method:

class SomeParent:
    def __init__(self):
        self.x = 1

class SomeChild(SomeParent):
    def __init__(self):
        # Initialize the super class
        SomeParent.__init__(self)
Loading history...
81
        self.issues = json.loads(json_issues)
82
    def toJSON(self):
83
        for t in self.walk(JugglerTask):
84
            for i in self.issues:
85
                if t.get_id() == i["id"]:
86
                    i["booking"] = t.walk(JugglerBooking)[0].decode()[0].isoformat()
87
        return json.dumps(self.issues, sort_keys=True, indent=4, separators=(',', ': '))
88
0 ignored issues
show
Trailing newlines
Loading history...
89