Showing 10 of 26 total issues
Method refresh
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def refresh
schedule = {
service_types: {},
service_type_teams: {},
records: {},
- 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 refresh
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def refresh
schedule = {
service_types: {},
service_type_teams: {},
records: {},
Function render
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
selected,
organizations
} = this.state;
Function connectLaunchpad
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function connectLaunchpad() {
launchpad = new Launchpad(navigator);
launchpad.onConnect(function() {
resetLaunchpadColors();
Function NavUserProfile
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const NavUserProfile = (props) => {
const {
email,
logout_url
} = props;
Function renderRefreshButton
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderRefreshButton() {
const {
has_token,
organization,
is_refreshing
Function generateTeamPositionRowCells
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateTeamPositionRowCells(context) {
const {
schedule,
serviceTypeId,
teamId,
Method sync
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def sync
@plan = PCO::Plan.find(params[:set_id])
ids_to_delete = @plan.pco_plan_items.map(&:pco_id).to_a
api.plan_items(@plan.pco_service_type.pco_id, @plan.pco_id).each do |item|
- 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 enumerate_paged_response
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def enumerate_paged_response(per_page: 25)
offset = 0
fetch_more = true
all_data = []
- 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 save_song
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def save_song(song)
attrs = song['attributes']
song_model = PCO::Song.where(organization_id: @org_id, pco_id: song['id'])
.first_or_create
- 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"