The following issues were found
collectors/python.d.plugin/python_modules/pyyaml3/serializer.py
56 issues
Line: 5
Column: 1
__all__ = ['Serializer', 'SerializerError']
from .error import YAMLError
from .events import *
from .nodes import *
class SerializerError(YAMLError):
pass
Reported by Pylint.
Line: 6
Column: 1
__all__ = ['Serializer', 'SerializerError']
from .error import YAMLError
from .events import *
from .nodes import *
class SerializerError(YAMLError):
pass
Reported by Pylint.
Line: 7
Column: 1
from .error import YAMLError
from .events import *
from .nodes import *
class SerializerError(YAMLError):
pass
class Serializer:
Reported by Pylint.
Line: 30
Column: 13
def open(self):
if self.closed is None:
self.emit(StreamStartEvent(encoding=self.use_encoding))
self.closed = False
elif self.closed:
raise SerializerError("serializer is closed")
else:
raise SerializerError("serializer is already opened")
Reported by Pylint.
Line: 30
Column: 23
def open(self):
if self.closed is None:
self.emit(StreamStartEvent(encoding=self.use_encoding))
self.closed = False
elif self.closed:
raise SerializerError("serializer is closed")
else:
raise SerializerError("serializer is already opened")
Reported by Pylint.
Line: 41
Column: 23
if self.closed is None:
raise SerializerError("serializer is not opened")
elif not self.closed:
self.emit(StreamEndEvent())
self.closed = True
#def __del__(self):
# self.close()
Reported by Pylint.
Line: 41
Column: 13
if self.closed is None:
raise SerializerError("serializer is not opened")
elif not self.closed:
self.emit(StreamEndEvent())
self.closed = True
#def __del__(self):
# self.close()
Reported by Pylint.
Line: 52
Column: 9
raise SerializerError("serializer is not opened")
elif self.closed:
raise SerializerError("serializer is closed")
self.emit(DocumentStartEvent(explicit=self.use_explicit_start,
version=self.use_version, tags=self.use_tags))
self.anchor_node(node)
self.serialize_node(node, None, None)
self.emit(DocumentEndEvent(explicit=self.use_explicit_end))
self.serialized_nodes = {}
Reported by Pylint.
Line: 52
Column: 19
raise SerializerError("serializer is not opened")
elif self.closed:
raise SerializerError("serializer is closed")
self.emit(DocumentStartEvent(explicit=self.use_explicit_start,
version=self.use_version, tags=self.use_tags))
self.anchor_node(node)
self.serialize_node(node, None, None)
self.emit(DocumentEndEvent(explicit=self.use_explicit_end))
self.serialized_nodes = {}
Reported by Pylint.
Line: 56
Column: 9
version=self.use_version, tags=self.use_tags))
self.anchor_node(node)
self.serialize_node(node, None, None)
self.emit(DocumentEndEvent(explicit=self.use_explicit_end))
self.serialized_nodes = {}
self.anchors = {}
self.last_anchor_id = 0
def anchor_node(self, node):
Reported by Pylint.
collectors/python.d.plugin/python_modules/pyyaml3/loader.py
56 issues
Line: 5
Column: 1
__all__ = ['BaseLoader', 'SafeLoader', 'Loader']
from .reader import *
from .scanner import *
from .parser import *
from .composer import *
from .constructor import *
from .resolver import *
Reported by Pylint.
Line: 6
Column: 1
__all__ = ['BaseLoader', 'SafeLoader', 'Loader']
from .reader import *
from .scanner import *
from .parser import *
from .composer import *
from .constructor import *
from .resolver import *
Reported by Pylint.
Line: 7
Column: 1
from .reader import *
from .scanner import *
from .parser import *
from .composer import *
from .constructor import *
from .resolver import *
class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver):
Reported by Pylint.
Line: 8
Column: 1
from .reader import *
from .scanner import *
from .parser import *
from .composer import *
from .constructor import *
from .resolver import *
class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver):
Reported by Pylint.
Line: 9
Column: 1
from .scanner import *
from .parser import *
from .composer import *
from .constructor import *
from .resolver import *
class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver):
def __init__(self, stream):
Reported by Pylint.
Line: 10
Column: 1
from .parser import *
from .composer import *
from .constructor import *
from .resolver import *
class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver):
def __init__(self, stream):
Reader.__init__(self, stream)
Reported by Pylint.
Line: 12
Column: 53
from .constructor import *
from .resolver import *
class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver):
def __init__(self, stream):
Reader.__init__(self, stream)
Scanner.__init__(self)
Parser.__init__(self)
Reported by Pylint.
Line: 12
Column: 26
from .constructor import *
from .resolver import *
class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver):
def __init__(self, stream):
Reader.__init__(self, stream)
Scanner.__init__(self)
Parser.__init__(self)
Reported by Pylint.
Line: 12
Column: 18
from .constructor import *
from .resolver import *
class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver):
def __init__(self, stream):
Reader.__init__(self, stream)
Scanner.__init__(self)
Parser.__init__(self)
Reported by Pylint.
Line: 12
Column: 35
from .constructor import *
from .resolver import *
class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver):
def __init__(self, stream):
Reader.__init__(self, stream)
Scanner.__init__(self)
Parser.__init__(self)
Reported by Pylint.
collectors/python.d.plugin/python_modules/urllib3/response.py
55 issues
Line: 10
Column: 1
from socket import timeout as SocketTimeout
from socket import error as SocketError
from ._collections import HTTPHeaderDict
from .exceptions import (
BodyNotHttplibCompatible, ProtocolError, DecodeError, ReadTimeoutError,
ResponseNotChunked, IncompleteRead, InvalidHeader
)
from .packages.six import string_types as basestring, binary_type, PY3
Reported by Pylint.
Line: 11
Column: 1
from socket import error as SocketError
from ._collections import HTTPHeaderDict
from .exceptions import (
BodyNotHttplibCompatible, ProtocolError, DecodeError, ReadTimeoutError,
ResponseNotChunked, IncompleteRead, InvalidHeader
)
from .packages.six import string_types as basestring, binary_type, PY3
from .packages.six.moves import http_client as httplib
Reported by Pylint.
Line: 15
Column: 1
BodyNotHttplibCompatible, ProtocolError, DecodeError, ReadTimeoutError,
ResponseNotChunked, IncompleteRead, InvalidHeader
)
from .packages.six import string_types as basestring, binary_type, PY3
from .packages.six.moves import http_client as httplib
from .connection import HTTPException, BaseSSLError
from .util.response import is_fp_closed, is_response_to_head
log = logging.getLogger(__name__)
Reported by Pylint.
Line: 16
Column: 1
ResponseNotChunked, IncompleteRead, InvalidHeader
)
from .packages.six import string_types as basestring, binary_type, PY3
from .packages.six.moves import http_client as httplib
from .connection import HTTPException, BaseSSLError
from .util.response import is_fp_closed, is_response_to_head
log = logging.getLogger(__name__)
Reported by Pylint.
Line: 17
Column: 1
)
from .packages.six import string_types as basestring, binary_type, PY3
from .packages.six.moves import http_client as httplib
from .connection import HTTPException, BaseSSLError
from .util.response import is_fp_closed, is_response_to_head
log = logging.getLogger(__name__)
Reported by Pylint.
Line: 18
Column: 1
from .packages.six import string_types as basestring, binary_type, PY3
from .packages.six.moves import http_client as httplib
from .connection import HTTPException, BaseSSLError
from .util.response import is_fp_closed, is_response_to_head
log = logging.getLogger(__name__)
class DeflateDecoder(object):
Reported by Pylint.
Line: 114
Column: 5
CONTENT_DECODERS = ['gzip', 'deflate']
REDIRECT_STATUSES = [301, 302, 303, 307, 308]
def __init__(self, body='', headers=None, status=0, version=0, reason=None,
strict=0, preload_content=True, decode_content=True,
original_response=None, pool=None, connection=None,
retries=None, enforce_content_length=False, request_method=None):
if isinstance(headers, HTTPHeaderDict):
Reported by Pylint.
Line: 179
Column: 9
if not self._pool or not self._connection:
return
self._pool._put_conn(self._connection)
self._connection = None
@property
def data(self):
# For backwords-compat with earlier urllib3 0.4 and earlier.
Reported by Pylint.
Line: 270
Column: 13
data = self._decoder.decompress(data)
except (IOError, zlib.error) as e:
content_encoding = self.headers.get('content-encoding', '').lower()
raise DecodeError(
"Received response with content-encoding: %s, but "
"failed to decode it." % content_encoding, e)
if flush_decoder and decode_content:
data += self._flush_decoder()
Reported by Pylint.
Line: 306
Column: 3
yield
except SocketTimeout:
# FIXME: Ideally we'd like to include the url in the ReadTimeoutError but
# there is yet no clean way to get at it from this context.
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
except BaseSSLError as e:
# FIXME: Is there a better way to differentiate between SSLErrors?
Reported by Pylint.
daemon/analytics.c
55 issues
Line: 738
Column: 15
CWE codes:
362
20
Suggestion:
Reconsider approach
// read the link /etc/localtime
if (!timezone) {
ret = readlink("/etc/localtime", buffer, FILENAME_MAX);
if (ret > 0) {
buffer[ret] = '\0';
char *cmp = "/usr/share/zoneinfo/";
Reported by FlawFinder.
Line: 319
Column: 5
CWE codes:
120
Suggestion:
Use sprintf_s, snprintf, or vsnprintf
char *script;
script = mallocz(
sizeof(char) * (strlen(netdata_configured_primary_plugins_dir) + strlen("alarm-notify.sh dump_methods") + 2));
sprintf(script, "%s/%s", netdata_configured_primary_plugins_dir, "alarm-notify.sh");
if (unlikely(access(script, R_OK) != 0)) {
info("Alarm notify script %s not found.", script);
freez(script);
return;
}
Reported by FlawFinder.
Line: 320
Column: 18
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
script = mallocz(
sizeof(char) * (strlen(netdata_configured_primary_plugins_dir) + strlen("alarm-notify.sh dump_methods") + 2));
sprintf(script, "%s/%s", netdata_configured_primary_plugins_dir, "alarm-notify.sh");
if (unlikely(access(script, R_OK) != 0)) {
info("Alarm notify script %s not found.", script);
freez(script);
return;
}
Reported by FlawFinder.
Line: 949
Column: 9
CWE codes:
120
Suggestion:
Use sprintf_s, snprintf, or vsnprintf
char *optout_file = mallocz(
sizeof(char) *
(strlen(netdata_configured_user_config_dir) + strlen(".opt-out-from-anonymous-statistics") + 2));
sprintf(optout_file, "%s/%s", netdata_configured_user_config_dir, ".opt-out-from-anonymous-statistics");
if (likely(access(optout_file, R_OK) != 0)) {
as_script = mallocz(
sizeof(char) *
(strlen(netdata_configured_primary_plugins_dir) + strlen("anonymous-statistics.sh") + 2));
sprintf(as_script, "%s/%s", netdata_configured_primary_plugins_dir, "anonymous-statistics.sh");
Reported by FlawFinder.
Line: 950
Column: 20
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
sizeof(char) *
(strlen(netdata_configured_user_config_dir) + strlen(".opt-out-from-anonymous-statistics") + 2));
sprintf(optout_file, "%s/%s", netdata_configured_user_config_dir, ".opt-out-from-anonymous-statistics");
if (likely(access(optout_file, R_OK) != 0)) {
as_script = mallocz(
sizeof(char) *
(strlen(netdata_configured_primary_plugins_dir) + strlen("anonymous-statistics.sh") + 2));
sprintf(as_script, "%s/%s", netdata_configured_primary_plugins_dir, "anonymous-statistics.sh");
if (unlikely(access(as_script, R_OK) != 0)) {
Reported by FlawFinder.
Line: 954
Column: 13
CWE codes:
120
Suggestion:
Use sprintf_s, snprintf, or vsnprintf
as_script = mallocz(
sizeof(char) *
(strlen(netdata_configured_primary_plugins_dir) + strlen("anonymous-statistics.sh") + 2));
sprintf(as_script, "%s/%s", netdata_configured_primary_plugins_dir, "anonymous-statistics.sh");
if (unlikely(access(as_script, R_OK) != 0)) {
netdata_anonymous_statistics_enabled = 0;
info("Anonymous statistics script %s not found.", as_script);
freez(as_script);
} else {
Reported by FlawFinder.
Line: 955
Column: 26
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
sizeof(char) *
(strlen(netdata_configured_primary_plugins_dir) + strlen("anonymous-statistics.sh") + 2));
sprintf(as_script, "%s/%s", netdata_configured_primary_plugins_dir, "anonymous-statistics.sh");
if (unlikely(access(as_script, R_OK) != 0)) {
netdata_anonymous_statistics_enabled = 0;
info("Anonymous statistics script %s not found.", as_script);
freez(as_script);
} else {
netdata_anonymous_statistics_enabled = 1;
Reported by FlawFinder.
Line: 981
Column: 5
CWE codes:
120
Suggestion:
Use sprintf_s, snprintf, or vsnprintf
analytics_data.data_length + (ANALYTICS_NO_OF_ITEMS * 3) + 15));
pid_t command_pid;
sprintf(
command_to_run,
"%s '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' ",
as_script,
action,
action_result,
Reported by FlawFinder.
Line: 716
Column: 22
CWE codes:
807
20
Suggestion:
Check environment variables carefully before using them
{
// avoid flood calls to stat(/etc/localtime)
// http://stackoverflow.com/questions/4554271/how-to-avoid-excessive-stat-etc-localtime-calls-in-strftime-on-linux
const char *tz = getenv("TZ");
if (!tz || !*tz)
setenv("TZ", config_get(CONFIG_SECTION_GLOBAL, "TZ environment variable", ":/etc/localtime"), 0);
char buffer[FILENAME_MAX + 1] = "";
const char *timezone = NULL;
Reported by FlawFinder.
Line: 922
Column: 31
CWE codes:
807
20
Suggestion:
Check environment variables carefully before using them
get_system_timezone();
// set the path we need
char path[1024 + 1], *p = getenv("PATH");
if (!p)
p = "/bin:/usr/bin";
snprintfz(path, 1024, "%s:%s", p, "/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin");
setenv("PATH", config_get(CONFIG_SECTION_PLUGINS, "PATH environment variable", path), 1);
Reported by FlawFinder.
collectors/python.d.plugin/mysql/mysql.chart.py
53 issues
Line: 7
Column: 1
# Author: Ilya Mashchenko (ilyam8)
# SPDX-License-Identifier: GPL-3.0-or-later
from bases.FrameworkServices.MySQLService import MySQLService
# query executed on MySQL server
QUERY_GLOBAL = 'SHOW GLOBAL STATUS;'
QUERY_SLAVE = 'SHOW SLAVE STATUS;'
QUERY_VARIABLES = 'SHOW GLOBAL VARIABLES LIKE \'max_connections\';'
Reported by Pylint.
Line: 1
Column: 1
# -*- coding: utf-8 -*-
# Description: MySQL netdata python.d module
# Author: Pawel Krupa (paulfantom)
# Author: Ilya Mashchenko (ilyam8)
# SPDX-License-Identifier: GPL-3.0-or-later
from bases.FrameworkServices.MySQLService import MySQLService
# query executed on MySQL server
Reported by Pylint.
Line: 147
Column: 1
]
def slave_seconds(value):
try:
return int(value)
except (TypeError, ValueError):
return -1
Reported by Pylint.
Line: 154
Column: 1
return -1
def slave_running(value):
return 1 if value == 'Yes' else -1
SLAVE_STATS = [
('Seconds_Behind_Master', slave_seconds),
Reported by Pylint.
Line: 257
Column: 1
]
},
'queries_type': {
'options': [None, 'Query Type', 'queries/s', 'query_types', 'mysql.queries_type', 'stacked'],
'lines': [
['Com_select', 'select', 'incremental'],
['Com_delete', 'delete', 'incremental'],
['Com_update', 'update', 'incremental'],
['Com_insert', 'insert', 'incremental'],
Reported by Pylint.
Line: 320
Column: 1
]
},
'connections': {
'options': [None, 'Connections', 'connections/s', 'connections', 'mysql.connections', 'line'],
'lines': [
['Connections', 'all', 'incremental'],
['Aborted_connects', 'aborted', 'incremental']
]
},
Reported by Pylint.
Line: 327
Column: 1
]
},
'connections_active': {
'options': [None, 'Connections Active', 'connections', 'connections', 'mysql.connections_active', 'line'],
'lines': [
['Threads_connected', 'active', 'absolute'],
['max_connections', 'limit', 'absolute'],
['Max_used_connections', 'max_active', 'absolute']
]
Reported by Pylint.
Line: 350
Column: 1
]
},
'threads_creation_rate': {
'options': [None, 'Threads Creation Rate', 'threads/s', 'threads', 'mysql.threads_creation_rate', 'line'],
'lines': [
['Threads_created', 'created', 'incremental'],
]
},
'thread_cache_misses': {
Reported by Pylint.
Line: 356
Column: 1
]
},
'thread_cache_misses': {
'options': [None, 'mysql Threads Cache Misses', 'misses', 'threads', 'mysql.thread_cache_misses', 'area'],
'lines': [
['Thread_cache_misses', 'misses', 'absolute', 1, 100]
]
},
'innodb_io': {
Reported by Pylint.
Line: 369
Column: 1
]
},
'innodb_io_ops': {
'options': [None, 'InnoDB I/O Operations', 'operations/s', 'innodb', 'mysql.innodb_io_ops', 'line'],
'lines': [
['Innodb_data_reads', 'reads', 'incremental'],
['Innodb_data_writes', 'writes', 'incremental', -1, 1],
['Innodb_data_fsyncs', 'fsyncs', 'incremental']
]
Reported by Pylint.
collectors/python.d.plugin/python_modules/pyyaml3/tokens.py
52 issues
Line: 20
Column: 5
class DirectiveToken(Token):
id = '<directive>'
def __init__(self, name, value, start_mark, end_mark):
self.name = name
self.value = value
self.start_mark = start_mark
self.end_mark = end_mark
Reported by Pylint.
Line: 34
Column: 5
class StreamStartToken(Token):
id = '<stream start>'
def __init__(self, start_mark=None, end_mark=None,
encoding=None):
self.start_mark = start_mark
self.end_mark = end_mark
self.encoding = encoding
Reported by Pylint.
Line: 78
Column: 5
class AliasToken(Token):
id = '<alias>'
def __init__(self, value, start_mark, end_mark):
self.value = value
self.start_mark = start_mark
self.end_mark = end_mark
class AnchorToken(Token):
Reported by Pylint.
Line: 85
Column: 5
class AnchorToken(Token):
id = '<anchor>'
def __init__(self, value, start_mark, end_mark):
self.value = value
self.start_mark = start_mark
self.end_mark = end_mark
class TagToken(Token):
Reported by Pylint.
Line: 92
Column: 5
class TagToken(Token):
id = '<tag>'
def __init__(self, value, start_mark, end_mark):
self.value = value
self.start_mark = start_mark
self.end_mark = end_mark
class ScalarToken(Token):
Reported by Pylint.
Line: 99
Column: 5
class ScalarToken(Token):
id = '<scalar>'
def __init__(self, value, plain, start_mark, end_mark, style=None):
self.value = value
self.plain = plain
self.start_mark = start_mark
self.end_mark = end_mark
self.style = style
Reported by Pylint.
Line: 1
Column: 1
# SPDX-License-Identifier: MIT
class Token(object):
def __init__(self, start_mark, end_mark):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in self.__dict__
if not key.endswith('_mark')]
Reported by Pylint.
Line: 3
Column: 1
# SPDX-License-Identifier: MIT
class Token(object):
def __init__(self, start_mark, end_mark):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in self.__dict__
if not key.endswith('_mark')]
Reported by Pylint.
Line: 3
Column: 1
# SPDX-License-Identifier: MIT
class Token(object):
def __init__(self, start_mark, end_mark):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in self.__dict__
if not key.endswith('_mark')]
Reported by Pylint.
Line: 3
Column: 1
# SPDX-License-Identifier: MIT
class Token(object):
def __init__(self, start_mark, end_mark):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in self.__dict__
if not key.endswith('_mark')]
Reported by Pylint.
collectors/python.d.plugin/python_modules/pyyaml3/cyaml.py
52 issues
Line: 6
Column: 1
__all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader',
'CBaseDumper', 'CSafeDumper', 'CDumper']
from _yaml import CParser, CEmitter
from .constructor import *
from .serializer import *
from .representer import *
Reported by Pylint.
Line: 6
Column: 1
__all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader',
'CBaseDumper', 'CSafeDumper', 'CDumper']
from _yaml import CParser, CEmitter
from .constructor import *
from .serializer import *
from .representer import *
Reported by Pylint.
Line: 8
Column: 1
from _yaml import CParser, CEmitter
from .constructor import *
from .serializer import *
from .representer import *
from .resolver import *
Reported by Pylint.
Line: 10
Column: 1
from .constructor import *
from .serializer import *
from .representer import *
from .resolver import *
class CBaseLoader(CParser, BaseConstructor, BaseResolver):
Reported by Pylint.
Line: 11
Column: 1
from .constructor import *
from .serializer import *
from .representer import *
from .resolver import *
class CBaseLoader(CParser, BaseConstructor, BaseResolver):
Reported by Pylint.
Line: 13
Column: 1
from .serializer import *
from .representer import *
from .resolver import *
class CBaseLoader(CParser, BaseConstructor, BaseResolver):
def __init__(self, stream):
CParser.__init__(self, stream)
Reported by Pylint.
Line: 15
Column: 28
from .resolver import *
class CBaseLoader(CParser, BaseConstructor, BaseResolver):
def __init__(self, stream):
CParser.__init__(self, stream)
BaseConstructor.__init__(self)
BaseResolver.__init__(self)
Reported by Pylint.
Line: 15
Column: 45
from .resolver import *
class CBaseLoader(CParser, BaseConstructor, BaseResolver):
def __init__(self, stream):
CParser.__init__(self, stream)
BaseConstructor.__init__(self)
BaseResolver.__init__(self)
Reported by Pylint.
Line: 19
Column: 9
def __init__(self, stream):
CParser.__init__(self, stream)
BaseConstructor.__init__(self)
BaseResolver.__init__(self)
class CSafeLoader(CParser, SafeConstructor, Resolver):
def __init__(self, stream):
Reported by Pylint.
Line: 20
Column: 9
def __init__(self, stream):
CParser.__init__(self, stream)
BaseConstructor.__init__(self)
BaseResolver.__init__(self)
class CSafeLoader(CParser, SafeConstructor, Resolver):
def __init__(self, stream):
CParser.__init__(self, stream)
Reported by Pylint.
collectors/python.d.plugin/python_modules/pyyaml2/tokens.py
52 issues
Line: 20
Column: 5
class DirectiveToken(Token):
id = '<directive>'
def __init__(self, name, value, start_mark, end_mark):
self.name = name
self.value = value
self.start_mark = start_mark
self.end_mark = end_mark
Reported by Pylint.
Line: 34
Column: 5
class StreamStartToken(Token):
id = '<stream start>'
def __init__(self, start_mark=None, end_mark=None,
encoding=None):
self.start_mark = start_mark
self.end_mark = end_mark
self.encoding = encoding
Reported by Pylint.
Line: 78
Column: 5
class AliasToken(Token):
id = '<alias>'
def __init__(self, value, start_mark, end_mark):
self.value = value
self.start_mark = start_mark
self.end_mark = end_mark
class AnchorToken(Token):
Reported by Pylint.
Line: 85
Column: 5
class AnchorToken(Token):
id = '<anchor>'
def __init__(self, value, start_mark, end_mark):
self.value = value
self.start_mark = start_mark
self.end_mark = end_mark
class TagToken(Token):
Reported by Pylint.
Line: 92
Column: 5
class TagToken(Token):
id = '<tag>'
def __init__(self, value, start_mark, end_mark):
self.value = value
self.start_mark = start_mark
self.end_mark = end_mark
class ScalarToken(Token):
Reported by Pylint.
Line: 99
Column: 5
class ScalarToken(Token):
id = '<scalar>'
def __init__(self, value, plain, start_mark, end_mark, style=None):
self.value = value
self.plain = plain
self.start_mark = start_mark
self.end_mark = end_mark
self.style = style
Reported by Pylint.
Line: 1
Column: 1
# SPDX-License-Identifier: MIT
class Token(object):
def __init__(self, start_mark, end_mark):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in self.__dict__
if not key.endswith('_mark')]
Reported by Pylint.
Line: 3
Column: 1
# SPDX-License-Identifier: MIT
class Token(object):
def __init__(self, start_mark, end_mark):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in self.__dict__
if not key.endswith('_mark')]
Reported by Pylint.
Line: 3
Column: 1
# SPDX-License-Identifier: MIT
class Token(object):
def __init__(self, start_mark, end_mark):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in self.__dict__
if not key.endswith('_mark')]
Reported by Pylint.
Line: 3
Column: 1
# SPDX-License-Identifier: MIT
class Token(object):
def __init__(self, start_mark, end_mark):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in self.__dict__
if not key.endswith('_mark')]
Reported by Pylint.
collectors/python.d.plugin/python_modules/pyyaml2/cyaml.py
52 issues
Line: 6
Column: 1
__all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader',
'CBaseDumper', 'CSafeDumper', 'CDumper']
from _yaml import CParser, CEmitter
from constructor import *
from serializer import *
from representer import *
Reported by Pylint.
Line: 6
Column: 1
__all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader',
'CBaseDumper', 'CSafeDumper', 'CDumper']
from _yaml import CParser, CEmitter
from constructor import *
from serializer import *
from representer import *
Reported by Pylint.
Line: 8
Column: 1
from _yaml import CParser, CEmitter
from constructor import *
from serializer import *
from representer import *
from resolver import *
Reported by Pylint.
Line: 10
Column: 1
from constructor import *
from serializer import *
from representer import *
from resolver import *
class CBaseLoader(CParser, BaseConstructor, BaseResolver):
Reported by Pylint.
Line: 11
Column: 1
from constructor import *
from serializer import *
from representer import *
from resolver import *
class CBaseLoader(CParser, BaseConstructor, BaseResolver):
Reported by Pylint.
Line: 13
Column: 1
from serializer import *
from representer import *
from resolver import *
class CBaseLoader(CParser, BaseConstructor, BaseResolver):
def __init__(self, stream):
CParser.__init__(self, stream)
Reported by Pylint.
Line: 15
Column: 45
from resolver import *
class CBaseLoader(CParser, BaseConstructor, BaseResolver):
def __init__(self, stream):
CParser.__init__(self, stream)
BaseConstructor.__init__(self)
BaseResolver.__init__(self)
Reported by Pylint.
Line: 15
Column: 28
from resolver import *
class CBaseLoader(CParser, BaseConstructor, BaseResolver):
def __init__(self, stream):
CParser.__init__(self, stream)
BaseConstructor.__init__(self)
BaseResolver.__init__(self)
Reported by Pylint.
Line: 19
Column: 9
def __init__(self, stream):
CParser.__init__(self, stream)
BaseConstructor.__init__(self)
BaseResolver.__init__(self)
class CSafeLoader(CParser, SafeConstructor, Resolver):
def __init__(self, stream):
Reported by Pylint.
Line: 20
Column: 9
def __init__(self, stream):
CParser.__init__(self, stream)
BaseConstructor.__init__(self)
BaseResolver.__init__(self)
class CSafeLoader(CParser, SafeConstructor, Resolver):
def __init__(self, stream):
CParser.__init__(self, stream)
Reported by Pylint.
collectors/python.d.plugin/nginx_plus/nginx_plus.chart.py
51 issues
Line: 17
Column: 1
except ImportError:
from third_party.ordereddict import OrderedDict
from bases.FrameworkServices.UrlService import UrlService
ORDER = [
'requests_total',
'requests_current',
'connections_statistics',
Reported by Pylint.
Line: 432
Column: 9
self.error('URL is not defined')
return None
self._manager = self._build_manager()
if not self._manager:
return None
raw_data = self._get_raw_data()
if not raw_data:
Reported by Pylint.
Line: 1
Column: 1
# -*- coding: utf-8 -*-
# Description: nginx_plus netdata python.d module
# Author: Ilya Mashchenko (ilyam8)
# SPDX-License-Identifier: GPL-3.0-or-later
import re
from collections import defaultdict
from copy import deepcopy
Reported by Pylint.
Line: 13
Column: 5
from json import loads
try:
from collections import OrderedDict
except ImportError:
from third_party.ordereddict import OrderedDict
from bases.FrameworkServices.UrlService import UrlService
Reported by Pylint.
Line: 32
Column: 1
CHARTS = {
'requests_total': {
'options': [None, 'Requests Total', 'requests/s', 'requests', 'nginx_plus.requests_total', 'line'],
'lines': [
['requests_total', 'total', 'incremental']
]
},
'requests_current': {
Reported by Pylint.
Line: 38
Column: 1
]
},
'requests_current': {
'options': [None, 'Requests Current', 'requests', 'requests', 'nginx_plus.requests_current', 'line'],
'lines': [
['requests_current', 'current']
]
},
'connections_statistics': {
Reported by Pylint.
Line: 60
Column: 1
]
},
'ssl_handshakes': {
'options': [None, 'SSL Handshakes', 'handshakes/s', 'ssl', 'nginx_plus.ssl_handshakes', 'stacked'],
'lines': [
['ssl_handshakes', 'successful', 'incremental'],
['ssl_handshakes_failed', 'failed', 'incremental']
]
},
Reported by Pylint.
Line: 67
Column: 1
]
},
'ssl_session_reuses': {
'options': [None, 'Session Reuses', 'sessions/s', 'ssl', 'nginx_plus.ssl_session_reuses', 'line'],
'lines': [
['ssl_session_reuses', 'reused', 'incremental']
]
},
'ssl_memory_usage': {
Reported by Pylint.
Line: 73
Column: 1
]
},
'ssl_memory_usage': {
'options': [None, 'Memory Usage', 'percentage', 'ssl', 'nginx_plus.ssl_memory_usage', 'area'],
'lines': [
['ssl_memory_usage', 'usage', 'absolute', 1, 100]
]
},
'processes': {
Reported by Pylint.
Line: 87
Column: 1
}
def cache_charts(cache):
family = 'cache {0}'.format(cache.real_name)
charts = OrderedDict()
charts['{0}_traffic'.format(cache.name)] = {
'options': [None, 'Traffic', 'KiB', family, 'nginx_plus.cache_traffic', 'stacked'],
Reported by Pylint.