Showing 22 of 36 total issues
File HomeView.js
has 606 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* View Description
*
* @langversion JavaScript
*
Function createGraph
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
createGraph: function (){
var self = this;
var removing = false;
//Create a new ST instance
Function createGraph
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
createGraph: function (){
var self = this;
var removing = false;
//Create a new ST instance
- 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
HomeView
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
var HomeView = View.extend({
/*
* @private
*/
File application.rb
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'sinatra'
# require 'sinatra_warden'
require 'uri'
require 'sanitize'
Method get_concepts
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_concepts(type=nil,uri=nil, lang=nil, page=nil)
if uri.nil?
# return null to save resources
Function addSubtreeAndPagers
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
addSubtreeAndPagers: function(nodeId, tree) {
var paginator_right = '_pag_r_' + nodeId;
var paginator_left = '_pag_l_' + nodeId;
var pag = this.idToLevelsPageNum[nodeId];
Method get_concepts
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_concepts(type=nil,uri=nil, lang=nil, page=nil)
if uri.nil?
# return null to save resources
- 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 initSearchBox
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
initSearchBox: function(){
var sURL = '/api/getsimilarconcepts?lang='+this.currentLang
$("#selector").select2({
width: '100%',
Method get_concept
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_concept(uri=nil, lang=nil)
if uri.nil?
# return null to save resources
Function getNewSubtree
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
getNewSubtree: function(nodeId) {
var self = this;
var data, uri = '';
Function addIdsFromUris
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
addIdsFromUris: function (tree) {
var self = this;
var newTree = _.map(tree,function (obj) {
- 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 paginateUpdate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
paginateUpdate: function(parentNode, newSubtree) {
var self = this;
var node = self.graph.graph.getNode(parentNode);
Method get_ontologies
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_ontologies(lang=nil)
if lang.nil? || !lang.length == 2
lang = 'EN'
else
Function customRenderingFunctionsInit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
customRenderingFunctionsInit: function () {
$jit.ST.Plot.NodeTypes.implement({
'nodeline': {
'render': function(node, canvas, animating) {
- 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 initializeScreen
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
initializeScreen: function () {
var ua = navigator.userAgent;
var iStuff = ua.match(/iPhone/i) || ua.match(/iPad/i);
var typeOfCanvas = typeof HTMLCanvasElement;
- 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
Avoid too many return
statements within this method. Open
return encoder.encode({ :name=>ylabel, :id=>'', :uri=>uri.to_s, :pages=>pages, :page=>page, :related_count=>relateds_count, :children=>parents_list, :related=>relateds_list })
Method get_similar_concepts
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_similar_concepts(term=nil, lang=nil)
if term.nil?
# save resources and return null
return encoder.encode({})
- 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
Method get_concept
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_concept(uri=nil, lang=nil)
if uri.nil?
# return null to save resources
- 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 paginate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
paginate: function(node, fx) {
var parentNode = this.computeParentNode(node);
var subtree;
- 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"