{"record":{"id":"664165fb285f0a07","repo":"Semantic-Org/Semantic-UI","slug":"no-maximum-rating-specified-cannot-generate-html","errorCode":null,"errorMessage":"No maximum rating specified. Cannot generate HTML automatically","messagePattern":"No maximum rating specified\\. Cannot generate HTML automatically","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/definitions/modules/rating.js","lineNumber":472,"sourceCode":"  namespace     : 'rating',\n\n  slent         : false,\n  debug         : false,\n  verbose       : false,\n  performance   : true,\n\n  initialRating : 0,\n  interactive   : true,\n  maxRating     : 4,\n  clearable     : 'auto',\n\n  fireOnInit    : false,\n\n  onRate        : function(rating){},\n\n  error         : {\n    method    : 'The method you called is not defined',\n    noMaximum : 'No maximum rating specified. Cannot generate HTML automatically'\n  },\n\n\n  metadata: {\n    rating    : 'rating',\n    maxRating : 'maxRating'\n  },\n\n  className : {\n    active   : 'active',\n    disabled : 'disabled',\n    selected : 'selected',\n    loading  : 'loading'\n  },\n\n  selector  : {\n    icon : '.icon'\n  },","sourceCodeStart":454,"sourceCodeEnd":490,"githubUrl":"https://github.com/Semantic-Org/Semantic-UI/blob/597843ab84d565cccfd8fd7719416350ae73e734/src/definitions/modules/rating.js#L454-L490","documentation":"NOTE: this message is registered in settings.error but is never invoked anywhere in rating.js — no module.error(error.noMaximum) call exists. setup.layout() reads get.maxRating() (defaulting to settings.maxRating = 4) and renders that many icons via templates.icon() with no guard. The string is effectively dead documentation; it would have warned that auto-generating star HTML requires a maxRating.","triggerScenarios":"Not actually triggered at runtime. The scenario it describes: a .ui.rating element with no <i class=\"icon\"> children and no maxRating (data-max-rating / settings.maxRating) — setup.layout() would call templates.icon(maxRating) with a falsy maxRating, producing zero stars. You get no stars, but also no error.","commonSituations":"<div class=\"ui rating\"></div> with no icons and no maxRating — the symptom is an empty rating, not a logged error.","solutions":["Provide a maxRating: data-max-rating=\"5\" or { maxRating: 5 }","Or include the icon markup manually: <div class=\"ui rating\"><i class=\"icon\"></i> ...</div>"],"exampleFix":"<!-- before -->\n<div class=\"ui rating\"></div>\n<!-- after -->\n<div class=\"ui rating\" data-max-rating=\"5\"></div>","handlingStrategy":"validation","validationCode":"// Ensure a maxRating exists before relying on auto-generated icons.\nfunction ratingHasMax($el, settings) {\n  settings = settings || {};\n  var n = settings.maxRating || $el.data('maxRating') || $el.attr('data-max-rating');\n  return Number(n) > 0;\n}\nif (ratingHasMax($('.ui.rating'))) {\n  $('.ui.rating').rating();\n} else {\n  $('.ui.rating').rating({ maxRating: 5 }); // supply a default\n}","typeGuard":"function hasMaxRating(settings) {\n  return !!settings && Number.isFinite(settings.maxRating) && settings.maxRating > 0;\n}","tryCatchPattern":null,"preventionTips":["Always set data-max-rating or { maxRating: N } on .ui.rating elements that start without icon markup","In component wrappers, default maxRating to a sane number instead of leaving it unset","Note that the registered error is never logged, so verify star rendering visually"],"tags":["rating","semantic-ui","config","dead-code"],"backgroundTag":null,"analyzedSha":"597843ab84d565cccfd8fd7719416350ae73e734","analyzedAt":"2026-08-13T01:44:23.827Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}