enclose-io/compiler

View on GitHub
lts/deps/v8/tools/js2c.py

Summary

Maintainability
A
3 hrs
Test Coverage

File js2c.py has 252 lines of code (exceeds 250 allowed). Consider refactoring.
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
Severity: Minor
Found in lts/deps/v8/tools/js2c.py - About 2 hrs to fix

    Function JS2C has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def JS2C(sources, target, native_type, raw_file, startup_blob, emit_js):
    Severity: Minor
    Found in lts/deps/v8/tools/js2c.py - About 45 mins to fix

      Function PutInt has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      def PutInt(blob_file, value):
        assert(value >= 0 and value < (1 << 28))
        if (value < 1 << 6):
          size = 1
        elif (value < 1 << 14):
      Severity: Minor
      Found in lts/deps/v8/tools/js2c.py - About 25 mins to fix

      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"

      Further reading

      There are no issues that match your filters.

      Category
      Status