Showing 13 of 13 total issues
File utils.js
has 381 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
BINDING_REDUNDANT_ATTRIBUTE_KEY,
BINDING_SELECTOR_KEY,
BINDING_SELECTOR_PREFIX,
BINDING_TEMPLATE_KEY,
Function javascript
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function javascript(sourceNode, source, meta, ast) {
const preprocessorName = getPreprocessorTypeByAttribute(sourceNode)
const javascriptNode = addLinesOffset(
sourceNode.text.text,
source,
Function createEachBinding
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function createEachBinding(
sourceNode,
selectorAttribute,
sourceFile,
sourceCode,
Function createTagBinding
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function createTagBinding(
sourceNode,
selectorAttribute,
sourceFile,
sourceCode,
Function compile
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function compile(source, opts = {}) {
const meta = createMeta(source, opts)
const { options } = meta
const { code, map } = runPreprocessor(
'template',
Function addComponentInterfaceToExportedObject
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function addComponentInterfaceToExportedObject(ast, componentInterface) {
const body = getProgramBody(ast)
const RiotComponentWrapperImportSpecifier = builders.importSpecifier(
builders.identifier(RIOT_INTERFACE_WRAPPER_NAME),
)
Function css
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function css(sourceNode, source, meta, ast) {
const preprocessorName = getPreprocessorTypeByAttribute(sourceNode)
const { options } = meta
const preprocessorOutput = preprocess(
'css',
Function createSlotBinding
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function createSlotBinding(
sourceNode,
selectorAttribute,
sourceFile,
sourceCode,
Function createTagWithBindings
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createTagWithBindings(sourceNode, sourceFile, sourceCode) {
const bindingsSelector = isRootNode(sourceNode)
? null
: createBindingSelector()
const cloneNode = createBindingsTag(sourceNode, bindingsSelector)
Function build
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function build(sourceNode, sourceFile, sourceCode, state) {
if (!sourceNode)
panic(
"Something went wrong with your tag DOM parsing, your tag template can't be created",
)
Function nodeToString
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
export function nodeToString(node) {
const attributes = staticAttributesToString(node)
switch (true) {
case isTagNode(node):
- 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"
Further reading
Function createExpression
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
sourceNode,
sourceFile,
sourceCode,
childNodeIndex,
parentNode,
Function javascript
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function javascript(sourceNode, source, meta, ast) {
const preprocessorName = getPreprocessorTypeByAttribute(sourceNode)
const javascriptNode = addLinesOffset(
sourceNode.text.text,
source,
- 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"