lizard 1.17.23__tar.gz → 1.17.25__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.23 → lizard-1.17.25}/PKG-INFO +19 -4
- {lizard-1.17.23 → lizard-1.17.25}/README.rst +18 -3
- {lizard-1.17.23 → lizard-1.17.25}/lizard.egg-info/PKG-INFO +19 -4
- {lizard-1.17.23 → lizard-1.17.25}/lizard.py +6 -2
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/version.py +1 -1
- lizard-1.17.25/lizard_languages/script_language.py +31 -0
- lizard-1.17.23/lizard_languages/script_language.py +0 -21
- {lizard-1.17.23 → lizard-1.17.25}/LICENSE.txt +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard.egg-info/SOURCES.txt +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard.egg-info/dependency_links.txt +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard.egg-info/entry_points.txt +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard.egg-info/requires.txt +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard.egg-info/top_level.txt +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/__init__.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/auto_open.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/csvoutput.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/default_ordered_dict.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/extension_base.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/htmloutput.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/keywords.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/lizardboolcount.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/lizardcomplextags.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/lizardcpre.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/lizarddependencycount.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/lizarddumpcomments.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/lizardduplicate.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/lizardduplicated_param_list.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/lizardexitcount.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/lizardgotocount.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/lizardignoreassert.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/lizardio.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/lizardmccabe.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/lizardmodified.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/lizardnd.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/lizardnonstrict.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/lizardns.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/lizardoutside.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/lizardstatementcount.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/lizardwordcount.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_ext/xmloutput.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/__init__.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/clike.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/code_reader.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/csharp.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/erlang.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/fortran.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/gdscript.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/go.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/golike.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/java.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/javascript.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/js_style_language_states.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/js_style_regex_expression.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/jsx.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/kotlin.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/lua.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/objc.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/perl.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/php.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/python.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/ruby.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/rubylike.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/rust.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/scala.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/solidity.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/swift.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/tnsdl.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/tsx.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/ttcn.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/typescript.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/vue.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/lizard_languages/zig.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/setup.cfg +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/setup.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testApplication.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testAssertionExtension.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testBasicFunctionInfo.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testCOutsideComplexity.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testCPreprocessorExtension.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testCommentOptions.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testCyclomaticComplexity.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testExtension.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testFilesFilter.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testFunctionDependencyCount.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testFunctionExitCount.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testFunctionGotoCount.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testFunctionStatementCount.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testHelpers.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testLanguages.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testMcCabe.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testNestedStructures.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testNestingDepth.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testOutput.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testOutputCSV.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testOutputFile.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testOutputHTML.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/testTokenizer.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/test_analyzer.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/test/test_auto_open.py +0 -0
- {lizard-1.17.23 → lizard-1.17.25}/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.25
|
|
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/
|
|
@@ -334,13 +334,28 @@ Options in Comments
|
|
|
334
334
|
-------------------
|
|
335
335
|
|
|
336
336
|
You can use options in the comments of the source code to change the
|
|
337
|
-
behavior of lizard.
|
|
338
|
-
|
|
337
|
+
behavior of lizard. There are two types of forgiveness comments:
|
|
338
|
+
|
|
339
|
+
1. Function forgiveness: Put "#lizard forgives" inside a function or before a function to suppress warnings for that function.
|
|
339
340
|
|
|
340
341
|
::
|
|
341
342
|
|
|
342
343
|
int foo() {
|
|
343
|
-
// #lizard forgives
|
|
344
|
+
// #lizard forgives
|
|
345
|
+
...
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
2. Global code forgiveness: Put "#lizard forgive global" before global code to suppress warnings for all code outside of functions.
|
|
349
|
+
|
|
350
|
+
::
|
|
351
|
+
|
|
352
|
+
// #lizard forgive global
|
|
353
|
+
int global_var = 0;
|
|
354
|
+
if (condition) { // This complexity won't be counted
|
|
355
|
+
...
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
int foo() { // Functions are still counted normally
|
|
344
359
|
...
|
|
345
360
|
}
|
|
346
361
|
|
|
@@ -303,13 +303,28 @@ Options in Comments
|
|
|
303
303
|
-------------------
|
|
304
304
|
|
|
305
305
|
You can use options in the comments of the source code to change the
|
|
306
|
-
behavior of lizard.
|
|
307
|
-
|
|
306
|
+
behavior of lizard. There are two types of forgiveness comments:
|
|
307
|
+
|
|
308
|
+
1. Function forgiveness: Put "#lizard forgives" inside a function or before a function to suppress warnings for that function.
|
|
308
309
|
|
|
309
310
|
::
|
|
310
311
|
|
|
311
312
|
int foo() {
|
|
312
|
-
// #lizard forgives
|
|
313
|
+
// #lizard forgives
|
|
314
|
+
...
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
2. Global code forgiveness: Put "#lizard forgive global" before global code to suppress warnings for all code outside of functions.
|
|
318
|
+
|
|
319
|
+
::
|
|
320
|
+
|
|
321
|
+
// #lizard forgive global
|
|
322
|
+
int global_var = 0;
|
|
323
|
+
if (condition) { // This complexity won't be counted
|
|
324
|
+
...
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
int foo() { // Functions are still counted normally
|
|
313
328
|
...
|
|
314
329
|
}
|
|
315
330
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lizard
|
|
3
|
-
Version: 1.17.
|
|
3
|
+
Version: 1.17.25
|
|
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/
|
|
@@ -334,13 +334,28 @@ Options in Comments
|
|
|
334
334
|
-------------------
|
|
335
335
|
|
|
336
336
|
You can use options in the comments of the source code to change the
|
|
337
|
-
behavior of lizard.
|
|
338
|
-
|
|
337
|
+
behavior of lizard. There are two types of forgiveness comments:
|
|
338
|
+
|
|
339
|
+
1. Function forgiveness: Put "#lizard forgives" inside a function or before a function to suppress warnings for that function.
|
|
339
340
|
|
|
340
341
|
::
|
|
341
342
|
|
|
342
343
|
int foo() {
|
|
343
|
-
// #lizard forgives
|
|
344
|
+
// #lizard forgives
|
|
345
|
+
...
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
2. Global code forgiveness: Put "#lizard forgive global" before global code to suppress warnings for all code outside of functions.
|
|
349
|
+
|
|
350
|
+
::
|
|
351
|
+
|
|
352
|
+
// #lizard forgive global
|
|
353
|
+
int global_var = 0;
|
|
354
|
+
if (condition) { // This complexity won't be counted
|
|
355
|
+
...
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
int foo() { // Functions are still counted normally
|
|
344
359
|
...
|
|
345
360
|
}
|
|
346
361
|
|
|
@@ -418,6 +418,7 @@ class FileInfoBuilder(object):
|
|
|
418
418
|
self.fileinfo = FileInformation(filename, 0)
|
|
419
419
|
self.current_line = 0
|
|
420
420
|
self.forgive = False
|
|
421
|
+
self.forgive_global = False
|
|
421
422
|
self.newline = True
|
|
422
423
|
self.global_pseudo_function = FunctionInfo('*global*', filename, 0)
|
|
423
424
|
self.current_function = self.global_pseudo_function
|
|
@@ -481,7 +482,8 @@ class FileInfoBuilder(object):
|
|
|
481
482
|
|
|
482
483
|
def end_of_function(self):
|
|
483
484
|
if not self.forgive:
|
|
484
|
-
self.
|
|
485
|
+
if self.current_function.name != '*global*' or not self.forgive_global:
|
|
486
|
+
self.fileinfo.function_list.append(self.current_function)
|
|
485
487
|
self.forgive = False
|
|
486
488
|
if self.stacked_functions:
|
|
487
489
|
self.current_function = self.stacked_functions.pop()
|
|
@@ -501,7 +503,9 @@ def comment_counter(tokens, reader):
|
|
|
501
503
|
if comment is not None:
|
|
502
504
|
for _ in comment.splitlines()[1:]:
|
|
503
505
|
yield '\n'
|
|
504
|
-
if comment.strip().startswith("#lizard forgive"):
|
|
506
|
+
if comment.strip().startswith("#lizard forgive global"):
|
|
507
|
+
reader.context.forgive_global = True
|
|
508
|
+
elif comment.strip().startswith("#lizard forgive"):
|
|
505
509
|
reader.context.forgive = True
|
|
506
510
|
if "GENERATED CODE" in comment:
|
|
507
511
|
return
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'''
|
|
2
|
+
Common behaviours of script languages
|
|
3
|
+
'''
|
|
4
|
+
from .code_reader import CodeReader
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ScriptLanguageMixIn:
|
|
8
|
+
# pylint: disable=R0903
|
|
9
|
+
|
|
10
|
+
@staticmethod
|
|
11
|
+
def get_comment_from_token(token):
|
|
12
|
+
if token.startswith("#"):
|
|
13
|
+
# For forgiveness comments, return the entire comment with directive intact
|
|
14
|
+
stripped = token.lstrip('#').strip()
|
|
15
|
+
|
|
16
|
+
# Handle forgiveness directives with proper formatting
|
|
17
|
+
if stripped.startswith('lizard forgive global') or stripped.startswith('#lizard forgive global'):
|
|
18
|
+
return '#lizard forgive global' # Preserve global directive
|
|
19
|
+
elif stripped.startswith('lizard forgive') or stripped.startswith('#lizard forgive'):
|
|
20
|
+
return '#lizard forgive' # Return standardized forgiveness comment
|
|
21
|
+
|
|
22
|
+
return stripped # Return the stripped comment for other cases
|
|
23
|
+
return None
|
|
24
|
+
|
|
25
|
+
@staticmethod
|
|
26
|
+
def generate_common_tokens(source_code, addition, match_holder=None):
|
|
27
|
+
_until_end = r"(?:\\\n|[^\n])*"
|
|
28
|
+
return CodeReader.generate_tokens(
|
|
29
|
+
source_code,
|
|
30
|
+
r"|\#" + _until_end + addition,
|
|
31
|
+
match_holder)
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
'''
|
|
2
|
-
Common behaviours of script languages
|
|
3
|
-
'''
|
|
4
|
-
from .code_reader import CodeReader
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class ScriptLanguageMixIn:
|
|
8
|
-
# pylint: disable=R0903
|
|
9
|
-
|
|
10
|
-
@staticmethod
|
|
11
|
-
def get_comment_from_token(token):
|
|
12
|
-
if token.startswith("#"):
|
|
13
|
-
return token[1:]
|
|
14
|
-
|
|
15
|
-
@staticmethod
|
|
16
|
-
def generate_common_tokens(source_code, addition, match_holder=None):
|
|
17
|
-
_until_end = r"(?:\\\n|[^\n])*"
|
|
18
|
-
return CodeReader.generate_tokens(
|
|
19
|
-
source_code,
|
|
20
|
-
r"|\#" + _until_end + addition,
|
|
21
|
-
match_holder)
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|