Showing 17 of 227 total issues
Tree
has 44 methods (exceeds 20 allowed). Consider refactoring. Open
type Tree struct {
Root *Node // Root node
Comparator utils.Comparator // Key comparator
size int // Total number of keys in the tree
m int // order (maximum number of children)
- Create a ticketCreate a ticket
Tree
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
type Tree struct {
Root *Node
size int
Comparator utils.Comparator
}
- Create a ticketCreate a ticket
Function Viz
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Viz = function () {
function Viz() {
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
workerURL = _ref3.workerURL,
worker = _ref3.worker,
- Create a ticketCreate a ticket
File viz.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
Viz.js 2.1.1 (Graphviz 2.40.1, Expat 2.2.5, Emscripten 1.37.36)
Copyright (c) 2014-2018 Michael Daines
Licensed under MIT license
- Create a ticketCreate a ticket
Method Tree.Visualize
has 61 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (tree *Tree) Visualize() string {
it := tree.Iterator()
dotString := "digraph G{bgcolor=azure;"
nodeIndexCount := 0
subGraphNumber := 0
- Create a ticketCreate a ticket
Method Tree.Visualize
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
func (tree *Tree) Visualize() string {
it := tree.Iterator()
dotString := "digraph G{bgcolor=azure;"
nodeIndexCount := 0
subGraphNumber := 0
- Read upRead up
- Create a ticketCreate a ticket
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 svgXmlToImageElement
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function svgXmlToImageElement(svgXml) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref$scale = _ref.scale,
scale = _ref$scale === undefined ? defaultScale() : _ref$scale,
_ref$mimeType = _ref.mimeType,
- Create a ticketCreate a ticket
Function svgXmlToImageElementFabric
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function svgXmlToImageElementFabric(svgXml) {
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref2$scale = _ref2.scale,
scale = _ref2$scale === undefined ? defaultScale() : _ref2$scale,
_ref2$mimeType = _ref2.mimeType,
- Create a ticketCreate a ticket
Function WorkerWrapper
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
var WorkerWrapper = function () {
function WorkerWrapper(worker) {
var _this = this;
classCallCheck(this, WorkerWrapper);
- Create a ticketCreate a ticket
Method Iterator.Prev
has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring. Open
func (iterator *Iterator) Prev() bool {
if iterator.position == begin {
goto begin
}
if iterator.position == end {
- Read upRead up
- Create a ticketCreate a ticket
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 Iterator.Next
has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring. Open
func (iterator *Iterator) Next() bool {
if iterator.position == end {
goto end
}
if iterator.position == begin {
- Read upRead up
- Create a ticketCreate a ticket
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 Iterator.Next
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
func (iterator *Iterator) Next() bool {
// If already at end, go to end
if iterator.position == end {
goto end
}
- Read upRead up
- Create a ticketCreate a ticket
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 Iterator.Prev
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
func (iterator *Iterator) Prev() bool {
// If already at beginning, go to begin
if iterator.position == begin {
goto begin
}
- Read upRead up
- Create a ticketCreate a ticket
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 Tree.rebalance
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (tree *Tree) rebalance(node *Node, deletedKey interface{}) {
// check if rebalancing is needed
if node == nil || len(node.Entries) >= tree.minEntries() {
return
}
- Create a ticketCreate a ticket
Function main
has 7 return statements (exceeds 4 allowed). Open
func main() {
set := treeset.NewWithIntComparator()
set.Add(2, 3, 4, 2, 5, 6, 7, 8)
printSet("Initial", set) // [ 2 3 4 5 6 7 8 ]
- Create a ticketCreate a ticket
Function main
has 7 return statements (exceeds 4 allowed). Open
func main() {
m := treemap.NewWithStringComparator()
m.Put("g", 7)
m.Put("f", 6)
m.Put("e", 5)
- Create a ticketCreate a ticket
Method Tree.remove
has 6 return statements (exceeds 4 allowed). Open
func (t *Tree) remove(key interface{}, qp **Node) bool {
q := *qp
if q == nil {
return false
}
- Create a ticketCreate a ticket