Showing 28 of 47 total issues
File app.py
has 346 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import configparser
import json
Function compile
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function compile() {
if (cwd !== "") {
// エディタのテキストを読み出し,JSONに
// これをpythonに投げて,コンパイルリザルト,ログを受け取る
// コンパイルに成功すれば,PDFファイルをindex.htmlに追加する
- 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
File main.js
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
var editor;
var cwd = "";
$(window).load(init());
Function compile
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function compile() {
if (cwd !== "") {
// エディタのテキストを読み出し,JSONに
// これをpythonに投げて,コンパイルリザルト,ログを受け取る
// コンパイルに成功すれば,PDFファイルをindex.htmlに追加する
Function readFilelist
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function readFilelist(directoryItem) {
var json = JSON.stringify({
"_csrf_token": $("#_csrf_token").val()
});
Function init
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function init() {
editor = ace.edit("editor");
readDirectory($("#username").text());
$("#createDirectory").click(function () {
- 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 readDirectory
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function readDirectory() {
var json = JSON.stringify({
"_csrf_token": $("#_csrf_token").val()
});
Function check_csrf
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def check_csrf(request_, type_):
config = configparser.ConfigParser()
config.read(conf)
if config['dev']['check_csrf'] == 'true':
token = session['_csrf_token']
- 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 configureLdap
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function configureLdap() {
if ((!$("#ldap-address").val() || !$("#ldap-port").val()) || !$("#ldap-basedn").val()) {
$("#result-change-ldap").empty();
$("#result-change-ldap").append(
'<p class="result bg-danger">Please input LDAP Address, Port, BaseDN correctly</p>'
Function changePath
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function changePath() {
if (!$("#redpen-path").val() || !$("#java-home").val()) {
$("#result-change-path").empty();
$("#result-change-path").append(
'<p class="result bg-danger">Please input RedPen Path and/or JAVA_HOME</p>'
Function register
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function register() {
if (!$("#username").val() || !$("#password").val()) {
$("#result-user-registration").empty();
$("#result-user-registration").append(
'<p class="result bg-danger">Please input username and/or password</p>'
Function readFilelist
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function readFilelist(directoryItem) {
var json = JSON.stringify({
"_csrf_token": $("#_csrf_token").val()
});
- 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 read_filelist
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def read_filelist():
if not check_csrf(request, 'json'):
abort(403)
dictionary = {}
- 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 success
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
success: function (data) {
$("#filelist").empty();
var result = JSON.parse(data.ResultSet).result;
if (result !== "Failure") {
$("#cwd").text(cwd);
Function init
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init() {
editor = ace.edit("editor");
readDirectory($("#username").text());
$("#createDirectory").click(function () {
Function save_config
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def save_config():
if not check_csrf(request, 'json'):
abort(403)
dictionary = {}
Function success
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
success: function (data) {
$("#directorylist").empty();
$("#directorylist").append(
"<li><a data-toggle='modal' href='#createDirectoryModal'>Create directory</a></li>"
);
Function readConfig
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function readConfig() {
var json = JSON.stringify({
"_csrf_token": $("#_csrf_token").val()
});
Function setDirectory
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setDirectory(directoryItem) {
var json = JSON.stringify({
"name": directoryItem,
"_csrf_token": $("#_csrf_token").val()
});
Avoid too many return
statements within this function. Open
return