Showing 193 of 398 total issues
Function tmpl
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var tmpl = (function () {
var _cache = {};
function _tmpl (str, data) {
Function tmpl
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var tmpl = (function () {
var _cache = {}
function _tmpl (str, data) {
Function tmpl
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var tmpl = (function () {
var _cache = {}
function _tmpl (str, data) {
Function parseForStatement
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Parser.prototype.parseForStatement = function () {
var init = null;
var test = null;
var update = null;
var forIn = true;
Function CommentHandler
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var CommentHandler = (function () {
function CommentHandler() {
this.attach = false;
this.comments = [];
this.stack = [];
File tmpl.js
has 396 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* riot-tmpl v3.0.8, @license MIT, (c) 2015 Muut Inc. + contributors */
;(function (window) { // eslint-disable-line no-extra-semi
'use strict'
Consider simplifying this complex logical expression. Open
Open
if (str === '&&' || str === '||' || str === '==' || str === '!=' ||
str === '+=' || str === '-=' || str === '*=' || str === '/=' ||
str === '++' || str === '--' || str === '<<' || str === '>>' ||
str === '&=' || str === '|=' || str === '^=' || str === '%=' ||
str === '<=' || str === '>=' || str === '=>' || str === '**') {
File es6.tmpl.js
has 382 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* The riot template engine
* @version v3.0.8
*/
Function scanTemplate
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Scanner.prototype.scanTemplate = function () {
var cooked = '';
var terminated = false;
var start = this.index;
var head = (this.source[start] === '`');
Function skipRegex
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
Open
var skipRegex = (function () { //eslint-disable-line no-unused-vars
var beforeReChars = '[{(,;:?=|&!^~>%*/'
var beforeReWords = [
- 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 skipRegex
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
Open
var skipRegex = (function () { //eslint-disable-line no-unused-vars
// safe characters to precced a regex (including `=>`, `**`, and `...`)
var beforeReChars = '[{(,;:?=|&!^~>%*/'
- 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 parseGroupExpression
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Parser.prototype.parseGroupExpression = function () {
var expr;
this.expect('(');
if (this.match(')')) {
this.nextToken();
Function parsePrimaryExpression
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Parser.prototype.parsePrimaryExpression = function () {
var node = this.createNode();
var expr;
var value, token, raw;
switch (this.lookahead.type) {
Function scanStringLiteral
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Scanner.prototype.scanStringLiteral = function () {
var start = this.index;
var quote = this.source[start];
assert_1.assert((quote === '\'' || quote === '"'), 'String literal must starts with a quote');
++this.index;
Function lexJSX
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
JSXParser.prototype.lexJSX = function () {
var cp = this.scanner.source.charCodeAt(this.scanner.index);
// < > / : = { }
if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) {
var value = this.scanner.source[this.scanner.index++];
Function parseExportDeclaration
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Parser.prototype.parseExportDeclaration = function () {
if (this.context.inFunctionBody) {
this.throwError(messages_1.Messages.IllegalExportDeclaration);
}
var node = this.createNode();
Function parseStatement
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Parser.prototype.parseStatement = function () {
var statement = null;
switch (this.lookahead.type) {
case token_1.Token.BooleanLiteral:
case token_1.Token.NullLiteral:
Function parseClassElement
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Parser.prototype.parseClassElement = function (hasConstructor) {
var token = this.lookahead;
var node = this.createNode();
var kind;
var key;
Function parseObjectProperty
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Parser.prototype.parseObjectProperty = function (hasProto) {
var node = this.createNode();
var token = this.lookahead;
var kind;
var key;
Function Tokenizer
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Tokenizer = (function () {
function Tokenizer(code, config) {
this.errorHandler = new error_handler_1.ErrorHandler();
this.errorHandler.tolerant = config ? (typeof config.tolerant === 'boolean' && config.tolerant) : false;
this.scanner = new scanner_1.Scanner(code, this.errorHandler);