Showing 25 of 36 total issues
Function terminal
has 307 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var terminal = (function($) {
return function({ selector, lips, dynamic = false, name = 'terminal' }, undefined) {
var position;
var timer;
var help = lips.env.get('help');
Function terminal
has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring. Open
Open
var terminal = (function($) {
return function({ selector, lips, dynamic = false, name = 'terminal' }, undefined) {
var position;
var timer;
var help = lips.env.get('help');
- 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 token
has 157 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
token: function (stream, state) {
if (state.indentStack == null && stream.sol()) {
// update indentation, but only if indentStack is empty
state.indentation = stream.indentation();
}
Function Interpreter
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function Interpreter(): JSX.Element {
const [activeSnippet, setActiveSnippet] = useState(0);
const [size, setSize] = useState(1);
const ref = useRef<HTMLDivElement>();
Function init
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init() {
$('.terminal.lips').each(function() {
$(this).terminal().destroy().remove();
});
$.terminal.defaults.linksNoReferrer = true;
File terminal.js
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* This is example of usage of LIPS interprter with jQuery Terminal
*
* Features: tab completion
* parenthesis matching
File examples.ts
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const examples = [
{
description: `With LIPS you can mix Scheme and JavaScript. You can access all JavaScript objects. You can also call any functions from Scheme.
**NOTE**: you can hover over Scheme symbols and get tooltip with documentation.`,
File codemirror.js
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// Modification of Codemirror Scheme mode for LIPS Scheme
// based on version of addon from Codemirror 5.58.3
// Plus Scheme Hints for LIPS Standard library
// Copyright (c) by Jakub T. Jankiewicz
// Copyright (c) by Marijn Haverbeke and others
Function keypress
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
keypress: function(e) {
var term = this;
function is_open(token) {
return ['(', '['].indexOf(token) !== -1;
}
Function tooltips
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function tooltips($node, get_name, position) {
const selector = '.token.function, .token.keyword, .token.operator, .token.builtin, .token.name';
$node.on('mouseover', selector, function() {
var self = $(this);
var lips = term.interpreter;
Function Reference
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Reference = () => {
const [term, setTerm] = useState('');
const [index, setIndex] = useState<FuseIndex<{ name: string; doc: string; }>>();
const default_list = useMemo(() => {
Function Intro
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function Intro(): JSX.Element {
return (
<div className={styles.section}>
<Heading as="h2" className={styles.header}>Summary</Heading>
<p>
Function ScreenShotBox
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ScreenShotBox(): JSX.Element {
const { siteConfig } = useDocusaurusContext();
useScripts([
'https://cdn.jsdelivr.net/combine/npm/codemirror@5.58.3/lib/codemirror.js,npm/codemirror@5.58.3/mode/javascript/javascript.js,npm/codemirror@5.58.3/addon/edit/matchbrackets.js,gh/jcubic/lips@devel/lib/js/codemirror.js',
`${siteConfig.baseUrl}js/screenshooter.js`
Function Bookmark
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function Bookmark(): JSX.Element {
const ref = useRef<HTMLAnchorElement>();
useEffect(() => {
const url = 'https://cdn.jsdelivr.net/gh/jcubic/lips@devel/lib/js/bookmark.js';
fetch(url).then(function(res) {
Function initTerminal
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function initTerminal() {
const $ = globalThis.$;
$.terminal.syntax('scheme');
const $term = $('.term');
if (!original) {
Function Acknowledgment
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function Acknowledgment(): JSX.Element {
return (
<div className={styles.section}>
<Heading as="h2" className={styles.header}>Acknowledgments</Heading>
<ul>
Function term
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var term = $(selector).terminal(function(code, term) {
// format before executing mainly for strings in function docs
//code = new lips.Formatter(code).format();
return interpreter.exec(code, dynamic).then(function(ret) {
ret.forEach(function(ret) {
Avoid deeply nested control flow statements. Open
Open
if(typeof state.sExprComment == "number") state.sExprComment++;
Avoid deeply nested control flow statements. Open
Open
while ((letter = stream.eat(/[^\s\(\[\;\)\]]/)) != null) {
keyWord += letter;
}
Avoid deeply nested control flow statements. Open
Open
} else if (ch == ")" || ch == "]") {
returnType = BRACKET;
if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : "[")) {
popStack(state);