lizard 1.17.17__tar.gz → 1.17.18__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lizard-1.17.17 → lizard-1.17.18}/PKG-INFO +1 -1
- {lizard-1.17.17 → lizard-1.17.18}/lizard.egg-info/PKG-INFO +1 -1
- {lizard-1.17.17 → lizard-1.17.18}/lizard.py +1 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/version.py +1 -1
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/clike.py +8 -0
- lizard-1.17.18/lizard_languages/go.py +45 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/python.py +2 -1
- {lizard-1.17.17 → lizard-1.17.18}/test/testOutput.py +9 -0
- lizard-1.17.17/lizard_languages/go.py +0 -22
- {lizard-1.17.17 → lizard-1.17.18}/LICENSE.txt +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/README.rst +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard.egg-info/SOURCES.txt +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard.egg-info/dependency_links.txt +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard.egg-info/entry_points.txt +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard.egg-info/requires.txt +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard.egg-info/top_level.txt +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/__init__.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/auto_open.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/csvoutput.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/default_ordered_dict.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/extension_base.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/htmloutput.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/keywords.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/lizardboolcount.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/lizardcomplextags.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/lizardcpre.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/lizarddependencycount.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/lizarddumpcomments.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/lizardduplicate.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/lizardduplicated_param_list.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/lizardexitcount.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/lizardgotocount.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/lizardignoreassert.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/lizardio.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/lizardmccabe.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/lizardmodified.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/lizardnd.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/lizardnonstrict.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/lizardns.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/lizardoutside.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/lizardstatementcount.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/lizardwordcount.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_ext/xmloutput.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/__init__.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/code_reader.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/csharp.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/erlang.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/fortran.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/gdscript.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/golike.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/java.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/javascript.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/js_style_language_states.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/js_style_regex_expression.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/jsx.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/kotlin.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/lua.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/objc.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/php.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/ruby.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/rubylike.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/rust.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/scala.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/script_language.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/solidity.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/swift.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/tnsdl.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/tsx.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/ttcn.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/typescript.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/vue.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/lizard_languages/zig.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/setup.cfg +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/setup.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testApplication.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testAssertionExtension.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testBasicFunctionInfo.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testCOutsideComplexity.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testCPreprocessorExtension.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testCommentOptions.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testCyclomaticComplexity.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testExtension.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testFilesFilter.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testFunctionDependencyCount.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testFunctionExitCount.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testFunctionGotoCount.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testFunctionStatementCount.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testHelpers.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testLanguages.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testMcCabe.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testNestedStructures.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testNestingDepth.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testOutputCSV.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testOutputFile.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testOutputHTML.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/testTokenizer.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/test_analyzer.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/test_auto_open.py +0 -0
- {lizard-1.17.17 → lizard-1.17.18}/test/test_options.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lizard
|
|
3
|
-
Version: 1.17.
|
|
3
|
+
Version: 1.17.18
|
|
4
4
|
Summary: A code analyzer without caring the C/C++ header files. It works with Java, C/C++, JavaScript, Python, Ruby, Swift, Objective C. Metrics includes cyclomatic complexity number etc.
|
|
5
5
|
Home-page: http://www.lizard.ws
|
|
6
6
|
Download-URL: https://pypi.python.org/lizard/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lizard
|
|
3
|
-
Version: 1.17.
|
|
3
|
+
Version: 1.17.18
|
|
4
4
|
Summary: A code analyzer without caring the C/C++ header files. It works with Java, C/C++, JavaScript, Python, Ruby, Swift, Objective C. Metrics includes cyclomatic complexity number etc.
|
|
5
5
|
Home-page: http://www.lizard.ws
|
|
6
6
|
Download-URL: https://pypi.python.org/lizard/
|
|
@@ -30,6 +30,14 @@ class CLikeReader(CodeReader, CCppCommentsMixin):
|
|
|
30
30
|
CLikeNestingStackStates(context),
|
|
31
31
|
CppRValueRefStates(context))
|
|
32
32
|
|
|
33
|
+
@staticmethod
|
|
34
|
+
def generate_tokens(source_code, addition='', token_class=None):
|
|
35
|
+
# Add pattern for floating point literals to the token generation
|
|
36
|
+
addition = r"|(?:\d*\.\d+(?:[eE][-+]?\d+)?)" + \
|
|
37
|
+
r"|(?:\d+\.(?:\d+)?(?:[eE][-+]?\d+)?)" + \
|
|
38
|
+
addition
|
|
39
|
+
return CodeReader.generate_tokens(source_code, addition, token_class)
|
|
40
|
+
|
|
33
41
|
def preprocess(self, tokens):
|
|
34
42
|
tilde = False
|
|
35
43
|
for token in tokens:
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'''
|
|
2
|
+
Language parser for Go lang
|
|
3
|
+
'''
|
|
4
|
+
|
|
5
|
+
from .code_reader import CodeReader
|
|
6
|
+
from .clike import CCppCommentsMixin
|
|
7
|
+
from .golike import GoLikeStates
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class GoReader(CodeReader, CCppCommentsMixin):
|
|
11
|
+
# pylint: disable=R0903
|
|
12
|
+
|
|
13
|
+
ext = ['go']
|
|
14
|
+
language_names = ['go']
|
|
15
|
+
|
|
16
|
+
def __init__(self, context):
|
|
17
|
+
super(GoReader, self).__init__(context)
|
|
18
|
+
self.parallel_states = [GoStates(context)]
|
|
19
|
+
|
|
20
|
+
@staticmethod
|
|
21
|
+
def generate_tokens(source_code, addition='', token_class=None):
|
|
22
|
+
addition = addition + r"|`[^`]*`" # Add support for backtick-quoted strings
|
|
23
|
+
return CodeReader.generate_tokens(source_code, addition, token_class)
|
|
24
|
+
|
|
25
|
+
def __call__(self, tokens, reader):
|
|
26
|
+
self.context = reader.context
|
|
27
|
+
for token in tokens:
|
|
28
|
+
# Skip counting ? in backtick-quoted strings
|
|
29
|
+
if token.startswith('`') and token.endswith('`'):
|
|
30
|
+
for state in self.parallel_states:
|
|
31
|
+
state(token)
|
|
32
|
+
yield token
|
|
33
|
+
continue
|
|
34
|
+
|
|
35
|
+
# For non-backtick tokens, process normally
|
|
36
|
+
for state in self.parallel_states:
|
|
37
|
+
state(token)
|
|
38
|
+
yield token
|
|
39
|
+
for state in self.parallel_states:
|
|
40
|
+
state.statemachine_before_return()
|
|
41
|
+
self.eof()
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class GoStates(GoLikeStates): # pylint: disable=R0903
|
|
45
|
+
pass
|
|
@@ -42,7 +42,8 @@ class PythonReader(CodeReader, ScriptLanguageMixIn):
|
|
|
42
42
|
def generate_tokens(source_code, addition='', token_class=None):
|
|
43
43
|
return ScriptLanguageMixIn.generate_common_tokens(
|
|
44
44
|
source_code,
|
|
45
|
-
r"
|
|
45
|
+
r"|(?:\"\"\"(?:\\.|[^\"]|\"(?!\"\")|\"\"(?!\"))*\"\"\")" +
|
|
46
|
+
r"|(?:\'\'\'(?:\\.|[^\']|\'(?!\'\')|\'\'(?!\'))*\'\'\')",
|
|
46
47
|
token_class)
|
|
47
48
|
|
|
48
49
|
def preprocess(self, tokens):
|
|
@@ -86,6 +86,15 @@ class TestWarningOutput(StreamStdoutTestCase):
|
|
|
86
86
|
self.option.sorting = ['cyclomatic_complexity']
|
|
87
87
|
print_warnings(self.option, self.scheme, (x for x in []))
|
|
88
88
|
|
|
89
|
+
def test_warning_when_max_nesting_depth_missing(self):
|
|
90
|
+
self.foo.cyclomatic_complexity = 30
|
|
91
|
+
# Intentionally not setting max_nesting_depth
|
|
92
|
+
fileSummary = FileInformation("FILENAME", 123, [self.foo])
|
|
93
|
+
scheme = OutputScheme([Ext()])
|
|
94
|
+
count = print_clang_style_warning([fileSummary], self.option, scheme, None)
|
|
95
|
+
self.assertIn("FILENAME:100: warning: foo has 1 NLOC, 30 CCN, 1 token, 0 PARAM, 1 length", sys.stdout.stream)
|
|
96
|
+
self.assertEqual(1, count)
|
|
97
|
+
|
|
89
98
|
|
|
90
99
|
class TestFileInformationOutput(StreamStdoutTestCase):
|
|
91
100
|
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'''
|
|
2
|
-
Language parser for Go lang
|
|
3
|
-
'''
|
|
4
|
-
|
|
5
|
-
from .code_reader import CodeReader
|
|
6
|
-
from .clike import CCppCommentsMixin
|
|
7
|
-
from .golike import GoLikeStates
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class GoReader(CodeReader, CCppCommentsMixin):
|
|
11
|
-
# pylint: disable=R0903
|
|
12
|
-
|
|
13
|
-
ext = ['go']
|
|
14
|
-
language_names = ['go']
|
|
15
|
-
|
|
16
|
-
def __init__(self, context):
|
|
17
|
-
super(GoReader, self).__init__(context)
|
|
18
|
-
self.parallel_states = [GoStates(context)]
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class GoStates(GoLikeStates): # pylint: disable=R0903
|
|
22
|
-
pass
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|