lts/deps/v8/tools/js2c.py
File js2c.py
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
#!/usr/bin/env python
#
# Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
Function JS2C
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def JS2C(sources, target, native_type, raw_file, startup_blob, emit_js):
Function PutInt
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def PutInt(blob_file, value):
assert(value >= 0 and value < (1 << 28))
if (value < 1 << 6):
size = 1
elif (value < 1 << 14):
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"