Showing 9 of 16 total issues
Query
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
export default class Query {
/**
* The Query is the root object for all SPARQL requests
*
* @class Query
Function toString
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
toString(isSubQuery = false) {
var queryString = '';
if (!isSubQuery) {
if (this._config.base) {
- 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 constructor
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
constructor(...args) {
var splitTriple = null;
switch (args.length) {
case 3:
let valid = true;
- 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 submit
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
submit(queryString) {
var instance = this;
return new Promise(function (resolve, reject) {
var headers = {
'Content-Type': 'application/x-www-form-urlencoded',
Function constructor
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(...args) {
var splitTriple = null;
switch (args.length) {
case 3:
let valid = true;
Function toString
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
toString(isSubQuery = false) {
var queryString = '';
if (!isSubQuery) {
if (this._config.base) {
Function toString
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
toString() {
var result = `${this._optional ? 'OPTIONAL ' : ''}${this._union ? 'UNION ' : ''}{ `;
for (let element of this._elements) {
if (element.constructor.name === 'Query') {
result += `{ ${element.toString(true)} } `;
- 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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
constructor(value, prefixIndex = null) {
if (prefixIndex === null) {
prefixIndex = PrefixIndex;
}
if (value.indexOf(':') === -1) {
- 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 addElement
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
addElement(element, atIndex = -1) {
if (typeof element === 'string') {
element = new Triple(element);
}
if (this._allowedTypes.indexOf(element.constructor.name) > -1) {
- 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"