Showing 16,957 of 16,957 total issues
Function HSP
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
export default function HSP(props) {
const hsp = props.hsp;
const hspRef = createRef();
const printing = useDetectPrint();
const [chars, setChars] = useState(0)
- 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 graphIt
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
graphIt($queryDiv, $graphDiv, index, howMany, opts, inhits) {
/* barHeight: Height of each hit track.
* legend: Height reserved for the overview legend.
* margin: Margin around the svg element.
*/
Method has too many lines. [43/15] Open
def defaults
@defaults ||= {
host: '0.0.0.0',
port: 4567,
databases_widget: 'classic',
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
You can set literals you want to fold with CountAsOne
.
Available are: 'array', 'hash', and 'heredoc'. Each literal
will be counted as one line regardless of its actual size.
NOTE: The ExcludedMethods
configuration is deprecated and only kept
for backwards compatibility. Please use IgnoredMethods
instead.
Example: CountAsOne: ['array', 'heredoc']
def m
array = [ # +1
1,
2
]
hash = { # +3
key: 'value'
}
<<~HEREDOC # +1
Heredoc
content.
HEREDOC
end # 5 points
Function Chord
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
circosJS.Chord = function() {
circosJS.Track.call(this);
this.parseData = circosJS.parseChordData;
this.applyRules = function(rules, data) {
var datum, l, len, results, rule;
Function downloadsPanelJSX
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
downloadsPanelJSX() {
return (
<div className="downloads">
<div className="pl-px table mb-0 w-full">
<h4 className="text-sm font-bold mb-0 mt-2.5">
Function setupTooltip
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
setupTooltip() {
var selected = {};
$('.circos-distribution').on(
'click',
_.bind(function (event) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
<button className="flex text-sm text-seqblue hover:text-seqorange cloud-Post cursor-pointer py-0.5 px-0.5 w-full" onClick={this.shareCloudInit}>
<div className="relative flex gap-2 items-center group w-full">
<i className="fa fa-cloud"></i>
<div className="flex items-center">
<span className="w-full">Share to cloud</span>
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 126.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
<a id="sendEmail" className="flex text-sm text-seqblue hover:text-seqorange email-URL cursor-pointer py-0.5 px-0.5 w-full"
href={asMailtoHref(this.props.data.querydb, this.props.data.program, this.props.data.queries.length, window.location.href)}
target="_blank" rel="noopener noreferrer">
<div className="relative flex gap-2 items-center group w-full">
<i className="fa fa-envelope"></i>
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 126.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
var colors = d3.scaleLog()
.domain([
d3.min([1e-5, d3.min(hits.map(function (d) {
if (parseFloat(d.evalue) === 0.0) return undefined;
return d.evalue;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 124.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
var gradScale = d3.scaleLog()
.domain([
d3.min([1e-5, d3.min(hits.map(function (d) {
if (parseFloat(d.hitEvalue) === 0.0) return undefined;
return d.hitEvalue;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 124.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function Grapher
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Grapher(Graph) {
return function Component(props) {
const alwaysShowName = Graph.alwaysShowName === undefined ? false : Graph.alwaysShowName();
const printing = useDetectPrint();
const name = Graph.name(props);
Function Component
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function Component(props) {
const alwaysShowName = Graph.alwaysShowName === undefined ? false : Graph.alwaysShowName();
const printing = useDetectPrint();
const name = Graph.name(props);
const [width, setWidth] = useState(window.innerWidth);
Function get_styles
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
var get_styles = function () {
var styles = '';
for (var i = 0; i < document.styleSheets.length; i++) {
(function process_ss(ss) {
- 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 Grapher
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export default function Grapher(Graph) {
return function Component(props) {
const alwaysShowName = Graph.alwaysShowName === undefined ? false : Graph.alwaysShowName();
const printing = useDetectPrint();
const name = Graph.name(props);
- 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 sharingPanelJSX
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
sharingPanelJSX() {
return (
<div className="sharing-panel">
<div className="pl-px table mb-0 w-full">
<h4 className="text-sm font-bold mb-0 mt-2.5">
Function graphControls
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
graphControls($queryDiv, $graphDiv, isInit, opts, hits) {
var MIN_HITS_TO_SHOW = 20;
var totalHits, shownHits, lessButton, moreButton;
Function renderLayoutTicks
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
circosJS.renderLayoutTicks = function(conf, layout, d3, instance) {
var blockTicks, displayLabel, ticks;
blockTicks = function(d) {
var k,space;
k = (d.end - d.start) / d.len;
Function componentDidMount
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentDidMount() {
var self = this;
var FASTA_FORMAT = /^>/;
$(document).ready(function () {
Method has too many lines. [25/15] Open
def _make_blast_database(file, type, title, taxonomy)
cmd = "makeblastdb -parse_seqids -hash_index -in '#{file}'" \
" -dbtype #{type.to_s.slice(0, 4)} -title '#{title}'" \
" #{taxonomy}"
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
You can set literals you want to fold with CountAsOne
.
Available are: 'array', 'hash', and 'heredoc'. Each literal
will be counted as one line regardless of its actual size.
NOTE: The ExcludedMethods
configuration is deprecated and only kept
for backwards compatibility. Please use IgnoredMethods
instead.
Example: CountAsOne: ['array', 'heredoc']
def m
array = [ # +1
1,
2
]
hash = { # +3
key: 'value'
}
<<~HEREDOC # +1
Heredoc
content.
HEREDOC
end # 5 points
Method has too many lines. [25/15] Open
def self.sys(command, options = {})
# Available output channels
channels = %i[stdout stderr]
# Make temporary files to store output from stdout and stderr.
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
You can set literals you want to fold with CountAsOne
.
Available are: 'array', 'hash', and 'heredoc'. Each literal
will be counted as one line regardless of its actual size.
NOTE: The ExcludedMethods
configuration is deprecated and only kept
for backwards compatibility. Please use IgnoredMethods
instead.
Example: CountAsOne: ['array', 'heredoc']
def m
array = [ # +1
1,
2
]
hash = { # +3
key: 'value'
}
<<~HEREDOC # +1
Heredoc
content.
HEREDOC
end # 5 points